简体   繁体   English

我尝试使用WebMatrix.WebData,但即使卸载了该包,也一直收到此错误

[英]I tried to use WebMatrix.WebData, but keep getting this error, even after I uninstalled the package

I was trying to use the simplemembership but dont know how it works. 我试图使用simplemembership,但不知道它是如何工作的。 I tried to install WebMatrix.WebData but it got messy. 我尝试安装WebMatrix.WebData,但是它很混乱。 Now I cant get back to where I was. 现在我不能回到原来的位置。 Any help would be appreciated. 任何帮助,将不胜感激。 Here is the error: 这是错误:

Server Error in '/' Application.

Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[MethodAccessException: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed.]
   WebMatrix.WebData.PreApplicationStartCode.Start() +112

[InvalidOperationException: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +556
   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 WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Attempt by security transparent method 'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885044
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

What version of MVC? 什么版本的MVC? What version of Visual Studio? 什么版本的Visual Studio? Is this an old project or a fresh one. 这是旧项目还是新项目。

If it's a relatively new project, it may be easier to create a new shell solution with the authentication you desire - then pull in your models, controllers and views from the old solution. 如果这是一个相对较新的项目,则使用所需的身份验证创建新的Shell解决方案可能会更容易-然后从旧解决方案中引入模型,控制器和视图。

If it's a VS2013 MVC 5 project, you may be missing the 如果它是VS2013 MVC 5项目,则可能缺少

public partial class Startup

class in your root on the application. 类在应用程序的根目录中。

If you create a new empty solution, you can compare what's there and what should be in yours. 如果创建一个新的空解决方案,则可以比较其中的内容和应该包含的内容。

HOWEVER.... you need to first read up on Simplemembership.... 但是...您需要先阅读Simplemembership ....

http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and- asp-net-mvc-4-templates.aspx

从bin删除所有文件,然后重建解决方案对我有用

暂无
暂无

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

相关问题 Webmatrix.WebData登录方法导致异常 - Webmatrix.WebData Login method results in exception 使用Microsoft Fake Framework MVC4单元测试WebMatrix.WebData - Unit testing WebMatrix.WebData with Microsoft Fake Framework MVC4 WebMatrix.WebData无法从单独的ASP.NET应用程序中读取成员资格信息 - WebMatrix.WebData can't read membership information from a separate ASP.NET application 无法获取MVC5中引用的用于简单成员资格的Webmatrix.WebData? - Can't get Webmatrix.WebData for Simple Membership referenced in MVC5? WebMatrix.WebData.WebSecurity - 如何只通过PasswordResetToken获取UserName - WebMatrix.WebData.WebSecurity - How can I get UserName by only having PasswordResetToken WebMatrix WebData InitializeDatabaseConnection - WebMatrix WebData InitializeDatabaseConnection 我尝试使用 Oracle 命令运行此更新方法,但我不断收到错误消息“sql 命令未正确结束” - I have tried to run this update method using Oracle command but I keep getting an error as "sql command not properly ended" 即使在我使用splitOn参数后仍会得到异常 - Still getting the exception even after I use splitOn param 为什么即使在升级到 .net 5 之后,我仍然会收到“未定义的预定义类型 IsExternalInit”? - Why do I keep getting 'Predefined type IsExternalInit it not defined' even after upgrading to .net 5? 使用MySql的Webmatrix.WebData.WebSecurity无法正常工作。 WebSecurity.UserExists()检查中引发SQL语法错误 - Webmatrix.WebData.WebSecurity with MySql is not working. Throwing sql syntax error in WebSecurity.UserExists() check
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM