Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean 64 posts 116 karma points
    Feb 11, 2013 @ 14:53
    Sean
    0

    Upgrading to v6.0 causes: Error loading MacroEngine script (file: )

    Originating from v4.7.1 - I incrementally upgraded all the way to v6.0. Everything seems to be working (verified after each upgrade...errors corrected before moving to next version) except at the very top of the page now, I get:

     Error loading MacroEngine script (file: )

    Using ?umbdebugshowtrace=true I see:

    umbracoMacro Error Loading Razor Script (file: ) [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.    at System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath, String physicalPath)
      at System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig()
      at System.Web.WebPages.Razor.RazorBuildProvider.CreateHost()
      at System.Web.WebPages.Razor.RazorBuildProvider.get_Host()
      at System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode()
      at System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType()
      at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
      at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
      at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
      at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
      at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
      at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
      at System.Web.WebPages.BuildManagerWrapper.CreateInstanceOfType[T](String virtualPath)
      at System.Web.WebPages.VirtualPathFactoryManager.CreateInstanceOfType[T](String virtualPath)
      at System.Web.WebPages.WebPageBase.CreateInstanceFromVirtualPath(String virtualPath, IVirtualPathFactory virtualPathFactory)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

    AND

    macro   Error loading MacroEngine script (file: , Type: ''[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'.
      at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)

    Config files have been updated / verified with WinMerge. I've reinstalled the latest Countour and the site seems to be functioning otherwise. Could it be an MVC version issue?

    Thanks!

  • Niels Lynggaard 190 posts 548 karma points
    Feb 11, 2013 @ 15:26
    Niels Lynggaard
    0

    My Razor version has changed from 4.9.X to 6.0. In the 6.0 config the razor version is 2.0.0.0

     

     <sectionGroup name="system.web.webPages.razor" 
    type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, 
    System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
    PublicKeyToken=31BF3856AD364E35">
          <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
          <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
        </sectionGroup>
  • Sean 64 posts 116 karma points
    Feb 11, 2013 @ 19:28
    Sean
    0

    Thanks for the reply Niels, my config states the identical . I currently don't use Razor on this site actually, all customization is via XSLT.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2013 @ 19:48
    Jan Skovgaard
    100

    Hi Sean

    Did you also remember to merge the config files in the config folder? And did you also merge the changes in the web.config file?

    /Jan

  • Sean 64 posts 116 karma points
    Feb 11, 2013 @ 19:50
    Sean
    0

    Hi Jan, just went through ALL config files again in /config and the web.config. Confirmed everything is identical.

     ...my bad. There was one line missed from WinMerge ... and I initially missed it due to the comments and additions in the original web.config, made it look a bit convoluted in WinMerge _

    Lesson learned == DOUBLE CHECK CONFIG FILES!  .. thanks! ;) 

  • Warren 30 posts 95 karma points
    May 06, 2013 @ 23:36
    Warren
    0

    Hi Sean

    I am having a similiar problem. I have rebuilt my old stite which was in 4.10.1. I started with a blank ver 6 site and added back in my content etc..

    But I am also getting the same error for my razor scropts and my user controls.

    Can I ask what line you missed out? 

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft