Question

Either i am late to the party or i did something wrong. I am working with Visual Studio 2013 and i was trying to use Membership class however, using System.Web.Security; namespace doesn't exist in my assemblies.

What can i do to solve this?

Note: System.Web exists

Targeting: .NET Framework 4.5.1

Was it helpful?

Solution 2

The System.Web namespace exists in System.dll

The System.Web.Security namespace exists in System.Web.dll

You can check this by going to the System.Web and System.Web.Security namespaces, opening one of the classes, and checking what the msdn article states is the dll (listed as the assembly).

OTHER TIPS

Actually, in .Net Framework 4+, the namespace System.Web.Security lives in the System.Web.ApplicationServices assembly, look for that one in the references

Guess I'm way to late, but if anyone has not got an answer I finally found it here:

https://msdn.microsoft.com/en-us/library/webmatrix.webdata.websecurity(v=vs.111).aspx

Add a Reference to: WebMatrix.WebData (you need to choose "Extentions") And you will have WebSecurity available

NOTE: You still need (System.Web.Security) for MemberShip & MemberShipUser

  1. Change Target framework from .net client profile ** to **.net

  2. Add System.Web assembly by references-->right click --> add references --> .net

  3. On top add using System.Web.Security;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top