Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class library can't find MembershipUser

I've added a class library project to my application.

In one of my classes, I need to use the MembershipUser class, but the project can't find it. I've added references to System.Web, System.Web.Security, and System.Security.Principal.

I'm not sure what the problem is. Has anyone run into this?

like image 596
Steven Avatar asked Jan 16 '11 21:01

Steven


1 Answers

If you are using .NET 4.0 you need to reference the System.Web.ApplicationServices.dll assembly. As always the documentation of the MembershipUser contains all the necessary information:

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

In previous versions of the framework the MembershipUser class was located in the System.Web.dll assembly.

like image 170
Darin Dimitrov Avatar answered Sep 21 '22 17:09

Darin Dimitrov