- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
使用 Visual Studio 2013,我将一个混合的 Asp.Net Webforms/MVC 3/Framework 4.0 Web 应用程序迁移到 Asp.Net Webforms/MVC 5.2.2/Framework 4.5.1。
我遵循了这些链接中概述的步骤:
当我在 visual studio 中运行应用程序时,出现此错误:
Attempt by security transparent method 'System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()' to access security critical method 'System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)' failed.
我已经尝试了在 StackOverflow 上找到的这些建议,但都没有解决问题:
任何有关如何找到此错误原因的建议将不胜感激。
错误的完整堆栈跟踪:
[MethodAccessException: Attempt by security transparent method 'System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()' to access security critical method 'System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)' failed.]
System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule() +96
System.Web.WebPages.Administration.PreApplicationStartCode.Start() +41
[InvalidOperationException: The pre-application start initialization method Start on type System.Web.WebPages.Administration.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()' to access security critical method 'System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)' failed..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +559
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.WebPages.Administration.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()' to access security critical method 'System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)' failed..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9913572
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
最佳答案
问题是 Web 应用程序引用了 System.Web.Administration.dll 的(框架 1)版本,我猜是因为几年前当应用程序从 Web 表单迁移到混合表单时需要这个引用网络表单/MVC 3.
我删除了这个引用,问题就消失了。显然这个 dll 不再被使用。我假设运行时正在从这个 dll 中获取冲突版本的 System.Web.Administration,而不是使用新版本。
关于c# - System.Web.WebPages 中的 MethodAccessException 将 mvc 3 迁移到 mvc 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25775234/
我的应用程序有一个在客户端运行的 websocket 客户端,我正在使用 websocket 上传文件。 我有一个 wicket 网页,它有两种上传 USB 文件的方法(自动和输入类型文件)当我的页面
当我们尝试在 sitecore 7.1 应用程序中浏览图像时,出现以下错误,该错误已从 6.2 迁移到 7.1。 Type 'ASP._Page_sitecore_shell_client_Speak
在从 6.2 迁移到 7.1 的 Sitecore 7.1 中打开图像时,出现以下错误: Type 'ASP._Page_sitecore_shell_client_Speak_Layouts_Lay
我得到: Type 'ASP._Page_index_cshtml' does not inherit from 'System.Web.WebPages.WebPage'. 当我浏览到我的index
我在配置 asp.net mvc 应用程序时遇到问题: [HttpException (0x80004005): Type 'ASP._Page_Currency_Index_cshtml' does
我遵循了非常相似的帖子提供的答案,您将在下面列出的逐步步骤中看到。 Razor view Type does not inherit from 'System.Web.WebPages.WebPage
这个问题在这里已经有了答案: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to... web.conf
我正在我的 Android 应用程序上集成 payumoney 支付网关。但是当我尝试通过测试借记卡进行测试交易时。它显示一个错误。当我联系 payumoney 客户服务时,他们说将服务器的 URL
我有一个网页,每 5 秒左右通过从服务器获取数据在 AJAX 中 self 更新。但是,我想只在用户主动查看页面时执行更新。 当用户在另一个选项卡上,在浏览器以外的另一个程序中,或者页面不是用户 PC
Google 是如何制作每天替换 Google Logo 的小动画的? 我知道去年全世界在工作中玩吃 bean 人时损失了将近 500 万小时(但这是值得的 :D)。但是这些互动小游戏还是让我印象深刻
我的本地主机上有一个 HTML 文件,我想要整个页面的屏幕截图。有谁知道一些截取整个页面(本地主机)的软件?我找到了一些插件,但它们不支持本地主机文件。 最佳答案 在 Windows 上按“Prt
我正在使用 PhantomJS 1.8.2 通过 JsTestDriver 运行一些 Jasmine 单元测试。使用 Chrome 测试运行良好,但使用 PhantomJS 时大约有一半的时间,测试结
我的本地主机上有一个 HTML 文件,我想要整个页面的屏幕截图。有谁知道一些截取整个页面(本地主机)的软件?我找到了一些插件,但它们不支持本地主机文件。 最佳答案 在 Windows 上按“Prt
import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface;
我需要点击一个链接,它实际上是 html 文件中的一个图像(左上角的 UCR 标志),我应该怎么做? 我有以下代码: url % follow_link("") 标志的html代码是:
为什么会这样? public class MainActivity extends Activity { WebView browser; @Override publ
我的来源: public class MainActivity extends DroidGap { @Override public void onCreate(Bu
我在godaddy购买了一个域名(www.domainname.com)。 我有一个 tomcat 服务器在路径 http://174.xxx.x.xx/WebApp1/webhome 部署了工作应用
我正在尝试完成一些可能相对简单的事情,但我不知道我会怎么调用它(如果有特定的名称),因此我的搜索被证明是无用的。 我想要完成的很简单:我有一个基于 Masonry jquery 插件(类似于 http
是否有任何自动化工具可以在网站上找到损坏的内部链接——特别是针对基于 DNN 框架的网站。 (DotNetNuke)。 我们查看了 Xenu,但看不到登录页面。 任何建议 干杯。 最佳答案 我已经在博
我是一名优秀的程序员,十分优秀!