CS0103: The name 'Bundles' does not exist in the current context

81 views
Skip to first unread message

Jeff Minnis

unread,
Aug 6, 2020, 1:12:57 PM8/6/20
to Cassette
I am trying to publish our website. It works fine on debug and release but publish gives me this error. We are using ASP .NET 4.0. I am using Visual Study 2013 for this project.

Error:

    CS0103: The name 'Bundles' does not exist in the current context
    Line 28:     <meta name="viewport" content="width=device-width, initial-scale=1" />
    Line 29:     <%--<meta name="google-translate-customization" content="78033ccfddd8ecc6-eef53fe980f2236d-g873f5a559b682a69-a" />--%>
    Line 30:     <%=Bundles.RenderStylesheets()%>
    Line 31:     
    Line 32:     <script>


Web Config:

    <!-- Web.Config Configuration File -->
    <configuration>
      <system.web>
        <customErrors mode="Off"/>
      </system.web>
    </configuration>

Jeff Minnis

unread,
Aug 6, 2020, 5:38:34 PM8/6/20
to Cassette
Here is my config:
using Cassette;
using Cassette.Scripts;
using Cassette.Stylesheets;
using Cassette.BundleProcessing;
//using System.Web.Optimization;

namespace StudyXWebsite
{
    /// <summary>
    /// Configures the Cassette asset bundles for the web application.
    /// </summary>
    public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
    {
        public void Configure(BundleCollection bundles)
        {
            // TODO: Configure your bundles here...

            // This default configuration treats each file as a separate 'bundle'.
            // In production the content will be minified, but the files are not combined.
            // So you probably want to tweak these defaults!

            //bundles.AddPerIndividualFile<StylesheetBundle>("Content");
            //bundles.AddPerIndividualFile<ScriptBundle>("Scripts");

            bundles.Add<StylesheetBundle>("~/Styles/AllStyles.css");
            bundles.Add<ScriptBundle>("~/Scripts/GGS.js");
            bundles.Add<ScriptBundle>("~/Scripts/track.js"); 
 

            // To combine files, try something like this instead:
            //   bundles.Add<StylesheetBundle>("Content");
            // In production mode, all of ~/Content will be combined into a single bundle.
            
            // If you want a bundle per folder, try this:
            //   bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
            // Each immediate sub-directory of ~/Scripts will be combined into its own bundle.
            // This is useful when there are lots of scripts for different areas of the website.
        }
    }
}

Karunjit Singh

unread,
Aug 7, 2020, 1:59:53 AM8/7/20
to Cassette
Try adding the following to your web.config file's configuration section:

<?xml version="1.0"?>
<configuration>
    <cassette debug="false" cacheDirectory="App_Data\Cassette" rewriteHtml="true" allowRemoteDiagnostics="true"/>
</configuration>

Jeff Minnis

unread,
Aug 7, 2020, 3:07:28 PM8/7/20
to Cassette
I get an error:
the element configsections has invalid child element cassette

Jeff Minnis

unread,
Aug 7, 2020, 3:37:42 PM8/7/20
to Cassette
I tried a few things and I am getting this:

Server Error in '/studyx' Application.Initialization failed.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IsolatedStorage.IsolatedStorageException: Initialization failed.

Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:


[IsolatedStorageException: Initialization failed.] System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope) +953 System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType) +75 Cassette.Aspnet.ForAssembly.<.cctor>b__2() +19 System.Lazy`1.CreateValue() +708 System.Lazy`1.LazyInitValue() +184 Cassette.Aspnet.<>c__DisplayClass2.<GetCacheDirectory>b__0() +105 Cassette.IO.IsolatedStorageFile.get_Exists() +16 Cassette.Aspnet.WebHostSettingsConfiguration.IsStaticCacheManifest(CassetteSettings settings) +73 Cassette.Aspnet.WebHostSettingsConfiguration.Configure(CassetteSettings settings) +259 Cassette.ConfigurationEnumerableExtensions.Configure(IEnumerable`1 configurations, T configurable) +184 Cassette.CassetteSettings..ctor(IEnumerable`1 configurations) +44 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +217 Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +597 [TinyIoCResolutionException: Unable to resolve type: Cassette.CassetteSettings] Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +927 Cassette.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +160 Cassette.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +888 Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +486 [TinyIoCResolutionException: Unable to resolve type: Cassette.BundleCollection] Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +773 Cassette.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +160 Cassette.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +888 Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +486 [TinyIoCResolutionException: Unable to resolve type: Cassette.Views.BundlesHelper] Cassette.TinyIoC.TinyIoCContainer.ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) +773 Cassette.TinyIoC.SingletonFactory.GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) +160 Cassette.TinyIoC.TinyIoCContainer.ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) +888 System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +229 System.Linq.<CastIterator>d__97`1.MoveNext() +274 Cassette.HostBase.RunStartUpTasks() +85 Cassette.HostBase.Initialize() +197 Cassette.Aspnet.CassetteHttpModule.InitWithTraceLogging() +126 Cassette.Aspnet.CassetteHttpModule.Init(HttpApplication httpApplication) +142 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +580 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +353 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341 [HttpException (0x80004005): Unable to resolve type: Cassette.Views.BundlesHelper] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3062.0  

On Friday, August 7, 2020 at 12:59:53 AM UTC-5 sunn...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages