通过安全透明的方法尝试“WebMatrix.WebData。preApplicationStart code.Start() [英] Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()'
问题描述
更新:同为MVC 4〜5 MVC
Update: same for mvc 4 to mvc 5.
我开始了新的MVC 4项目并在其中(控制器/型号/脚本等)迁移的MVC 3项目。虽然现在一切都编译我收到以下错误:
I started a new mvc 4 project and migrated an mvc 3 project in it (controllers/models/scripts etc). While everything compiles now i get the following error:
由安全透明的方法尝试WebMatrix.WebData。preApplicationStart code.Start()访问关键安全法System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)'失败
Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.
我找不到与此错误在网络上的任何东西。进入应用程序开始前的错误命中。
I can't find anything on the web with this error. The error hits before getting into the application start.
我尝试重新安装使用的NuGet所有组件,将一个干净的web.config无济于事。
I tried reinstalling all assemblies with nuget, putting a 'clean' web.config to no avail.
任何人都收到了这个问题?
推荐答案
有关我这个错误是因为我没有更新从MVC 4 MVC 5.固定通过安装的NuGet包后安装Microsoft.AspNet.WebHelpers
For me this error was because I did NOT have Microsoft.AspNet.WebHelpers installed after updating from MVC 4 to MVC 5. It was fixed by installing the NuGet package
Install-Package -Id Microsoft.AspNet.WebHelpers
这篇关于通过安全透明的方法尝试“WebMatrix.WebData。preApplicationStart code.Start()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!