asp.net-mvc - 使用 MVC 错误配置 roleManager 提供程序

标签 asp.net-mvc web-config role-manager

自从我把我的 MVC 项目运行时,我总是遇到错误
此代码在我的 web.config 上文件。

<roleManager defaultProvider="CustomRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
        <clear />
        <add name="CustomRoleProvider" type="SM.MyRoleProvider"  />
      </providers>
    </roleManager>

这就是我的错误:

配置错误

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This method cannot be called during the application's pre-start initialization phase.



请问有人能告诉我这是怎么回事吗?

最佳答案

嗨,您必须进入视觉工作室并进入路径:
网站选项卡 -> ASP.NET 配置 -> 安全选项卡 -> 禁用角色

关于asp.net-mvc - 使用 MVC 错误配置 roleManager 提供程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29506375/

相关文章:

ASP.NET MVC url搜索参数不带问号

javascript - AJAX 调用后无法显示值 (ASP.NET MVC)

c# - Entity Framework 4.3 with MVC on Edit 不保存复杂对象

asp.net-mvc - 如何访问 Controller 外部的 RequestContext?

.net - 自定义 "A potentially dangerous Request.Path value was detected"错误页面

azure - 对于 Azure 应用程序部署中的多个参数之一,参数化 Web.config 失败

C# 通过配置文件忽略证书错误

asp.net - 为 Azure Active Directory 中的用户提供角色