I'm trying to create a custom role provider in a class library, and for some reason I can't reference System.Web.Security.RoleProvider.
I have added a reference to System.Web in the project, yet still no luck. Is there a reason why I can't do this?
You need to reference the assembly System.Web.ApplicationServices.dll. The RoleProvider class is not defined in System.Web.dll.
In this cases and when in doubt check the MSDN page for the associated class and at the top of the page you can see in what namespace and assembly it is defined.
For the RoleProvider class you have:
Namespace: System.Web.Security
Assembly: System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With