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

有帮助吗?

解决方案 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).

其他提示

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;

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top