I'm writing a simple utility console app to add new users, etc, to an SQL Server Membership Store.
The issue I'm running into is that I can't seem to add a reference to System.Web, so I can't access the Membership stuff. How does one go about doing this?
NOTE: I've found a few questions on stackoverflow that seem similar, but the answers revolved around MVC, and after attempting the suggested answers, the problem still remains.
Edit: Oded helped lead me to the answer. By default it was filtering by the "client profile", which doesn't have System.Web available. I had to retarget to .Net 4 instead of .Net 4 client profile as described in the following MSDN article.
Make sure you are targeting the full framework in your project (right click on the project node and select
Properties
) - In theApplication
tab there is a drop down forTarget Framework
.Make sure this does not use a client profile.
What exactly prevents to you to add reference to System.Web in a console application? Just add appropriate reference via references management in VS. After that you should configure your application with App.config and work with Membership services as in web applcation