【发布时间】:2015-11-04 13:38:44
【问题描述】:
我正在关注this site 上的教程。
在尝试实现自定义 RoleProvider 时,我收到以下错误。
Server Error in '/' Application
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
来源错误:
<providers>
<clear/>
<add name="MyroleProvider"type="MvcApplication1.Infrastructure.MyroleProvider"con ectionStringName="DatabaseContext" applicationName="/" />
</providers>
我已将 web.config 部分更新为以下内容,但仍然出现错误。
<roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="MyroleProvider">
<providers>
<clear/>
<add name="MyroleProvider" type="MvcApplication1.Infrastructure.MyroleProvider" connectionStringName="DatabaseContext" applicationName="/" />
</providers>
</roleManager>
【问题讨论】:
标签: asp.net-mvc-4