Link to RoleProvider in the class library

I am trying to create a custom role provider in a class library, and for some reason I cannot reference System.Web.Security.RoleProvider.

I added a link to System.Webin the project, but still no luck. Is there a reason why I cannot do this?

+5
source share
1 answer

You need to refer to the assembly System.Web.ApplicationServices.dll. The class is RoleProvidernot defined in System.Web.dll.

In this case, and when in doubt, check the MSDN page for the associated class and at the top of the page where you can see in which namespace and assembly they are defined.

For the class RoleProvideryou have:

: System.Web.Security

: System.Web.ApplicationServices( System.Web.ApplicationServices.dll)

+11

All Articles