I am using Umbraco 8, and .net framework 4.7.2, I have a site running correctly on my local, but when I publish it to my server, I got error as
Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
on server, it has .net framework 4.7.2, it has System.Web.WebPages.Razor.dll in my bin folder , its version is 3.0.7.
Also , I cleared files in Temporary ASP.NET Files, and I don't see in my code something is accessing System.Web.WebPages.Razor, Version=1.0.0.0
yes I have all these 4 .dll files on local and on server in \bin folder. For each file, time stamp, size, and product version are the same between my local and on server
ASP.NET version on server is 4.7.2, just installed last week, 2021-03-27.
I am not sure how to check Trust level, but I would think it is at correct level.
AppPool is using .Net 4.0.40319, there is no option to choose 4.7.2, all my other AppPools are all on 4.0.40319 although the sites are on 4.5.
I am not sure how to check whether .Net correctly registered in IIS. This website is an existing one, it was working before on old Umbraco version, we updated it to new Umbraco 8.
Could not load file or assembly
I am using Umbraco 8, and .net framework 4.7.2, I have a site running correctly on my local, but when I publish it to my server, I got error as
Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
on server, it has .net framework 4.7.2, it has System.Web.WebPages.Razor.dll in my bin folder , its version is 3.0.7. Also , I cleared files in Temporary ASP.NET Files, and I don't see in my code something is accessing System.Web.WebPages.Razor, Version=1.0.0.0
Can someone help me find out what the problem is?
Thanks
Hi
Try to reinstall MVC in your solution and redeploy -
Alex
thanks, I ran the command and it was successful: Successfully installed 'Microsoft.AspNet.Mvc 5.2.7'
then I published again, it didn't help, the error message stayed same
Check that you installed the asp.net MVC at least version 3 on the server
in my project, in NuGet management , the package Microsoft.AspNet.Mvc, it is version, 5.2.7.
on file system on my local, the "System.Web.Mvc.dll" has version 5.2.7-61128 same as the "System.Web.Mvc.dll" on the server
Did you install MVC on the web server?
hmmmm, I didn't, I don't know. what does it mean to install MVC on server? do I need to run some installation application? Thanks
Check all these dlls :
yes I have all these 4 .dll files on local and on server in \bin folder. For each file, time stamp, size, and product version are the same between my local and on server
what ASP.NET version installed on the server? Medium Trust?
ASP.NET version on server is 4.7.2, just installed last week, 2021-03-27. I am not sure how to check Trust level, but I would think it is at correct level.
Is your AppPool set to use the correct version of .Net? It is also possible that .Net is not correctly registered in IIS
AppPool is using .Net 4.0.40319, there is no option to choose 4.7.2, all my other AppPools are all on 4.0.40319 although the sites are on 4.5.
I am not sure how to check whether .Net correctly registered in IIS. This website is an existing one, it was working before on old Umbraco version, we updated it to new Umbraco 8.
Sounds like it should be setup ok, you could try adding a binding redirect for the assembly in your web.config
in Views\web.config, I have this
and I have error message as I mentioned in my first post
-* - * - * - -* - * - * - -* - * - * - -* - * - * - -* - * - * -
then I added binding direct in root\web.config, see attached image
then I got different error message as :
Attempt by security transparent method 'Microsoft.Web.Helpers.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
I am just running a basic Umbraco 8 site, using Visual Studio 2017, published to server from within VS.
I tried different projects, In one I made the base project with the MVC folders included, the other I didn't - they both failed the same way.
Definitely sounds like something odd on the server, is your umbraco published to an app folder in another site or its own website in iis?
It is its own website
Did you install any other nuget packages other than umbraco for your Vs project? Dou get any build errors or warnings in VS when you build it?
I didn't install other nuget packages , only the umbracocms, and I don't have build warning and error when I built it, it ran correctly on my local.
As a test, could you try publishing to a local folder and comparing the files to those on the server to see if anything is different.
something with the server
try to reset asp net setup
I think it is server issue too, so at this point, I will put a pause on this and try different direction, thank you very much for all your help!
Try using aspnet_regiis to reinstall .net into your site
is working on a reply...