[英]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.