Running System.Web.Razor 1.0 and 2.0 side by side?

I am trying to deploy my site to my hosting provider and continue to receive the following error:

Failed to load file or assembly "System.Web.Razor" or one of the dependencies. The installed assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

[FileLoadException: Could not load file or assembly "System.Web.Razor" or one of its dependencies. The installed assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Failed to load file or assembly. System.Web.Razor, Version = 2.0.0.0, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35 'or one of its dependencies. The installed assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

...

[ConfigurationErrorsException: Could not load file or assembly 'System.Web.Razor, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The installed assembly manifest definition does not match the Help assembly. (Exception from HRESULT: 0x80131040)]

...

[HttpException (0x80004005): Could not load file or assembly 'System.Web.Razor, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The installed assembly manifest definition does not match the Help assembly. (Exception from HRESULT: 0x80131040)]

...

The site is built using ASP.NET 4 and MVC 4. Everything works fine on my Windows 8 development machine. I copied the System.Web.Razor.dll file to the bin folder on the server, which does not make any difference, although this seems to be Version v1.0 (~ 260k).

I watched

  C: \ Windows \ Assembly 
and I don’t see anything in System.Web.Razor. However, I have the following two files:
  • C: \ Windows \ assembly \ NativeImages_v4.0.30319_64 \ System.Web.Razor \ 04eb82505c0086e8eb097d1408183aa0 \ System.Web.Razor.ni.dll (776k, file version: 1.0.20105.407)

  • C: \ Windows \ assembly \ NativeImages_v4.0.30319_64 \ System.Web.Razor \ ab032b45c588b488ebca535054d827bc \ System.Web.Razor.ni.dll (1823k, file version: 2.0.20715.0)

However, even copying the v2 assembly here did not work, although I do not think that this is the correct file, since the sizes of the v1 assembly files do not match either.

Any ideas on what's going on here?

I assume that my hosting provider does not have something installed (as they continue to tell me that everything is in the bin folder), but I am curious why I can not find this System.Web. Razor v2 dll anywhere.

To debug, I also uploaded an empty website with a basic template that worked fine. Interestingly, when I added the link to Postal and turned around again, I got an error - but even when I got the files back, the error persisted! Why is this going to happen?

Any help would be greatly appreciated. Starting to feel a bit of ideas.

Change 1

Created a new empty project, added Razor 2 from nuget, installed System.Web.Razor.dll to copy local (2.0.20715.0, 260k), published, grabbed the file and downloaded it and still got the same error? It seems that this dll just won't be raised.

Edit 2

In the end, I gave up trying to use this hosting provider. They did not have ASP.NET MVC 4 installed on the server, which I think ended up being a problem. I tried another host that has it installed, and everything works fine.

+4
source share

All Articles