【问题标题】:Role Provider couldn't be found in the System.web.security?在 System.web.security 中找不到角色提供者?
【发布时间】:2020-08-05 16:22:42
【问题描述】:

我想继承抽象类RoleProvider。但是,我收到错误 说 RoleProvider 在 Web.Security 命名空间中不存在。 这就是我所关注的 - https://msdn.microsoft.com/en-us/library/system.web.security.roleprovider(v=vs.110).aspx

这是我的课 -

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


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

    }
}

【问题讨论】:

    标签: c# asp.net-mvc


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      只需更改您的班级名称。

      看这个例子:

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

      【讨论】:

      • 不幸的是,事实并非如此。他指定了他想要继承的类的命名空间。
      猜你喜欢
      • 2020-10-09
      • 2023-03-14
      • 1970-01-01
      • 2011-02-17
      • 2012-04-08
      • 2013-10-21
      • 1970-01-01
      • 1970-01-01
      • 2016-09-05
      相关资源
      最近更新 更多