简体   繁体   English

卡在ASP.NET MVC DLL地狱,剃刀组件问题中

[英]Stuck in ASP.NET MVC DLL HELL, Razor Assembly issue

I'm currently dealing with a problem on a ASP.NET MVC4 Application, I did a change of .NET Framework (from 4.5 to 4 then to 4.5 again) and it updated my NuGet packages so my Web.config is all messed up and i can't get rid of those errors that the YSOD shows me. 我目前正在处理ASP.NET MVC4应用程序上的问题,我对.NET Framework进行了更改(从4.5更改为4,然后再次更改为4.5),它更新了我的NuGet程序包,因此我的Web.config都一团糟,我无法摆脱YSOD向我显示的那些错误。 Can you explain me a bit what can i do to correct those errors ? 您能给我解释一下如何纠正这些错误吗?

Here's the error i get. 这是我得到的错误。

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. 无法将[A] System.Web.WebPages.Razor.Configuration.HostSection强制转换为[B] System.Web.WebPages.Razor.Configuration.HostSection。 Type A 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'. 类型A源自'System.Web.WebPages.Razor,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'在上下文'Default'中的位置'C:\\ Windows \\ Microsoft.Net \\ assembly \\ GAC_MSIL \\ System .Web.WebPages.Razor \\ v4.0_2.0.0.0__31bf3856ad364e35 \\ System.Web.WebPages.Razor.dll'。 Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files\\root\\5ccfcdb0\\4d5a6f51\\assembly\\dl3\\5f700272\\1350df4e_ebe9ce01\\System.Web.WebPages.Razor.dll'. 类型B源自位置'C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319的上下文'默认'中的'System.Web.WebPages.Razor,Version = 3.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35' \\临时ASP.NET文件\\ root \\ 5ccfcdb0 \\ 4d5a6f51 \\ assembly \\ dl3 \\ 5f700272 \\ 1350df4e_ebe9ce01 \\ System.Web.WebPages.Razor.dll'。

Okay i solved my problem by myself. 好吧,我自己解决了我的问题。

I updated manually in the Web.config (from the Views Folder) the configuration to Version=3.0.0.0 and the version of the MvcWebRazorHostFactory (same file) to Version=5.0.0.0 我在Web.config中(从“视图”文件夹中)手动将配置更新为Version = 3.0.0.0,将MvcWebRazorHostFactory的版本(相同文件)更新为Version = 5.0.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM