Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'

Last post 10-15-2009 6:37 AM by Peter Strömblad. 2 replies.

Sort Posts:

  • Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'

    06-16-2006, 11:13 AM
    • Member
      10 point Member
    • kLAx
    • Member since 05-10-2005, 7:57 PM
    • Posts 2

    I always get the below exception if I make a configuration change to the web.config file then request a page without re-building the project.

    Exception:

    Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'.

    Stack Trace:

    [InvalidCastException]: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'.
       at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp)
       at System.Web.Compilation.BuildManager.CompileGlobalAsax()
       at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
    [HttpException]: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'.
       at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
       at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
       at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
    [HttpException]: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'.
       at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
       at System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
       at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest
    wr)

  • Re: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'

    06-19-2006, 11:33 AM
    • Member
      10 point Member
    • kLAx
    • Member since 05-10-2005, 7:57 PM
    • Posts 2

    I have now backed out the project from WAP as it requires frequent web.config amendments and appears not to be stable with a global.asax file.

  • Re: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'

    10-15-2009, 6:37 AM

    Change to a neutral assembly in AssemblyInfo.cs

    [assembly: AssemblyCulture("")]

    see further: http://support.microsoft.com/kb/924731

    or http://yurykorolev.blogspot.com/2007/10/localization-errors-in-aspnet.html 

    Filed under:
Page 1 of 1 (3 items)