Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.Security.MembershipCreateStatus not accessable from a Test project?

I coded a custom Membership provider and I want to run some Unit tests against it. However, whenever I create a "Test" project, I can't access MembershipCreateStatus. You may know that this is a type on an out parameter for CreateUser.

I am using VS2010 Ultimate and just can't seem to grasp why, even when I add a reference to System.Web (and for good faith a reference to all the libs in the membership provider project), I can't access it.

Is there something preventing it from being used in Test projects?

I am targeting 3.5 Framework.

Thanks!

like image 909
Dave Avatar asked Oct 28 '10 13:10

Dave


1 Answers

Ok figured it out...

System.Web.ApplicationServices.dll has a System.Web.Security namespace within it which contains the enum.

MSDN still lists it being in System.Web.dll for 3.5 framework (http://msdn.microsoft.com/en-us/library/system.web.security.membershipcreatestatus(v=VS.90).aspx)

However, I just noticed VS2010 doesn't let you create any 3.5 framework unit tests, they force 4.0 so that's why the difference. My membership is a 3.5 where the Enum is in System.Web and the unit test is force to 4.0 where it's in System.Web.ApplicationServices.

Is there a reason we can no longer create 3.5 unit tests in VS2010?

Thanks for anyone who looked at this.

like image 57
Dave Avatar answered Oct 20 '22 04:10

Dave