问题描述
早上好一切,
我试图实现,我已经在我的实例的默认网站下实现我的web应用程序我的自定义成员资格和角色提供IIS 7.我的web应用程序下一个.NET 4的应用程序池中运行。
I am attempting to implement my custom membership and role providers in my web application that I have implemented under the Default Web Site in my instance of IIS 7. My web application is running under a .NET 4 application pool.
然而,建立相应的web.config后,我收到以下错误:
However, after setting up the corresponding web.config, I get the following error:
Parser Error Message: Default Role Provider could not be found.
我已经包含的代码在相应的Web应用程序的Web的system.web节以下块。配置:
I have included the following block of code in the system.web section of the corresponding web application's web.config:
<membership defaultProvider="CustomMembershipProvider" userIsOnlineTimeWindow="20">
<providers>
<clear/>
<add name="CustomMembershipProvider" type="CustomProviders.CustomMembershipProvider,
CustomProviders, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=3563615169617648" applicationName="/"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="CustomRoleProvider">
<providers>
<clear/>
<add name="CustomRoleProvider" type="CustomProviders.CustomRoleProvider,
CustomProviders, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=3563615169617648" applicationName="/"/>
</providers>
</roleManager>
现在我已经看到了各种各样的解释对如何解决我前面提到的错误。他们中的大多数似乎暗示我添加标签到我的提供商块。
有些人似乎认为的的角色管理器。有的仍似乎表明最后的办法似乎没有考虑到我的web应用程序正在从IIS,而不是本地计算机上运行。
Now I have seen all sorts of explanations as to how solve the error that I mentioned earlier. Most of them seem to suggest that I add tags to my provider blocks.Some seem to suggest that I remove the role manager from the machine.config. And some still seem to suggest not removing or adding anything. This last approach does not seem to account that my web application is being run from IIS and not a local machine.
在最后,我已经尝试了这些方法收效甚微。可有人请向我解释,我怎么能获得通过这个错误?在此先感谢!
In the end, I have have tried these approaches to little avail. Can someone please explain to me how I can get passed this error? Thanks in advance!
推荐答案
我使用的是默认的MVC 4 Web应用程序时得到这个错误。
我有以下添加到web.config文件和错误走了。
在< system.webServer>
添加
I got this error when using the default MVC 4 web application.I had to add the following to web.config and the error went away.Under <system.webServer>
add
<modules>
<remove name="RoleManager"/>
</modules>
这篇关于默认角色提供程序无法在IIS 7上运行.NET 4中找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!