javascript - 在 ASP.Net MVC 中使用成员资格会引发异常

标签 javascript c# asp.net asp.net-mvc asp.net-membership

我正在尝试将成员(member)资格用于我的 MVC 项目。我添加了引用文献

WebMatrix.Data 2.0.0.0

WebMatrix.WebData 2.0.0.0

当我尝试运行我的项目时,它抛出异常

“尝试通过安全透明方法 'WebMatrix.WebData.PreApplicationStartCode.OnConnectionOpened(System.Object, WebMatrix.Data.ConnectionEventArgs)' 访问安全关键方法 'System.Web.WebPages.HttpContextExtensions.RegisterForDispose(System.Web.HttpContextBase) ,System.IDisposable)'失败。”

enter image description here

enter image description here

最佳答案

IIS 进程无权访问您的数据库。 作为修复,请确保应用程序池身份用户有权访问数据库的文件夹和文件。

关于javascript - 在 ASP.Net MVC 中使用成员资格会引发异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50921206/

相关文章:

c# - ASP.NET 中带有 UpdatePanel 的 CodeMirror

c#:更好的线程架构

c# - 将电子邮件作为主键是个坏主意吗?

javascript - 如何使用 jQuery 防止 mouseenter 事件操作

javascript - 在 React 组件之间调用函数

c# - 为什么是 "it is recommended to include foreign key property in the entity class"?

javascript - 使用 JSON.stringify 将 jQuery AJAX 发布到我的 ASP.NET web 服务

javascript - 如何更新反射(reflect)当前值的输入值?

javascript - 当浏览器支持新选项卡时,如何强制 window.open() 打开新选项卡?

c# - 文本框中的背景文本