本文介绍了如何阅读IPrincipal身份名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在写信寻求帮助,我如何获得以下行只读取身份名称。这是因为它当前抛出 - 角色管理器功能尚未启用错误。
Hi,
I am writing to seek help, in how do i get the following line to read only the identity names only. this is because it currently throws - "The Role Manager feature has not been enabled" error.
if (user.username != null)
{
// once the user is verified, assign it to an IPrincipal with the identity name and applicable roles
principal = new GenericPrincipal(new GenericIdentity(user.username));
return true;
}
非常感谢您的时间和帮助。
Many thanks for your time and help.
推荐答案
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
这篇关于如何阅读IPrincipal身份名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!