Copied to clipboard

Flag this post as spam?

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


  • Bruno Olsen 75 posts 316 karma points
    Aug 02, 2016 @ 07:55
    Bruno Olsen
    0

    Moving site: Could not load file or assembly 'System.Web.Razor...

    Hi

    We are moving several Umbraco sites from one server to another, however this one 6.1.1 site returns this error:

    Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.
    
    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.BadImageFormatException: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.
    
    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.
    
    Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
    
    
    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    
    Stack Trace: 
    
    
    [BadImageFormatException: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.]
       Microsoft.Web.Helpers.PreApplicationStartCode.Start() +0
    
    [InvalidOperationException: The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest..]
       System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +874
       System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +169
       System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +133
       System.Web.Compilation.BuildManager.ExecutePreAppStart() +176
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +734
    
    [HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest..]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
    

    Since there's no changes to anything, other than perhaps db connect string, we're wondering why this would happen.

    Does anybody have any ideas, clues or anything ?

    Kind regards, Bruno

  • Manjunatha Govindappa 20 posts 119 karma points
    Aug 02, 2016 @ 08:17
    Manjunatha Govindappa
    100

    Hi,

    May be you can cross verify below points

    1.Make sure MVC is installed on server 2. You have System.Web.Razor.dll file in bin folder 3. web.config have correct version of assembly reference 4. GAC loaded the correct version of dll

  • Bruno Olsen 75 posts 316 karma points
    Aug 02, 2016 @ 12:58
    Bruno Olsen
    0

    Hi Manjunatha

    We installed MVC and checked the other things. It turned out that MVC wasn't even installed on the old server, and yet we have many Umbraco's of different versions there.

    Anyway, for some reason it did the trick - at least in order for some errors in some code-behind to occur.

    Removing all of our own stuff made the server complain about the Global.asax file.

    So, clearly something must have gone wrong with the copying. So, we zipped it from the old server, and unzipped on the new - success :)

    So thanks for helping us getting a step further :)

    Kind regards, Bruno

Please Sign in or register to post replies

Write your reply to:

Draft