简体   繁体   English

在 System.web.security 中找不到角色提供程序?

[英]Role Provider couldn't be found in the System.web.security?

I want to inherit the abstract class RoleProvider.我想继承抽象类RoleProvider。 However, I am getting errors saying that RoleProvider doesn't exist in the Web.Security namespace.但是,我收到错误消息,指出 Web.Security 命名空间中不存在 RoleProvider。 This is what I am following - https://msdn.microsoft.com/en-us/library/system.web.security.roleprovider(v=vs.110).aspx这就是我所关注的 - https://msdn.microsoft.com/en-us/library/system.web.security.roleprovider(v=vs.110).aspx

This is my class -这是我的课——

using System;
using System.Collections.Generic;
using System.Linq;


namespace blogging.Infrastructure
{
    public class RoleProvider:  System.Web.Security.RoleProvider
    {

    }
}

检查您的项目中是否有对 System.Web.ApplicationServices.dll 的引用。

Just change your class name.只需更改您的班级名称。

See this example :请参阅此示例:

    public class AccountRoleProvider:  System.Web.Security.RoleProvider
    {

    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 角色提供者和System.Web.Security.Roles - Role provider and System.Web.Security.Roles 缺少System.Web.UI和System.Web.Security - Missing System.Web.UI and System.Web.Security 使用相同的数据库替代System.Web.Security - Alternative to System.Web.Security, using same database System.Web.Security中的ValidateUser使用简单密码 - ValidateUser in System.Web.Security takes simple password 使用实体服务/存储库模式时,在模型中引用 System.Web.Security 是不好的做法吗? - Is it bad practice to reference System.Web.Security in the model when using entity service/repository pattern? azure Web应用程序org.mentalis.security无法获取加密服务提供商上下文异常 - azure web app org.mentalis.security Couldn't acquire crypto service provider context exception 找不到角色“ A”,它给出了System.Configuration.Provider.ProviderException - The Role “A” was not found and gives System.Configuration.Provider.ProviderException System.Security.Claims.ClaimType 角色不匹配 - System.Security.Claims.ClaimType Role doesn't match 尝试将用户添加到角色,找不到System.Web.HttpContextBaseExtensions.GetOwinEnvironment - Trying to add user to role, System.Web.HttpContextBaseExtensions.GetOwinEnvironment not found EF6默认角色提供程序“未找到方法” - EF6 default role provider “method not found”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM