Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ASP.NET Membership providers in console application

I am creating a console application that will automatically create users into a database of a web application that is built in mvc and uses the built in membership provider and roles for forms authentication.

How can I use the AccountMembershipService and MembershipCreateStatus classes from that in a console application??? I've added assemblies and refrences to System.Web and System.Web.Mvc and security etc but cannot get it to recognise those classes.

like image 273
user1063793 Avatar asked Jan 19 '23 05:01

user1063793


1 Answers

Copy the relevant elements from your web projects web.config into the winforms app.config.

System.Web.Mvc is not required, and you'll also have to change from Net 4 Client Profile to .NET 4 under project settings.

like image 73
jgauffin Avatar answered Jan 20 '23 18:01

jgauffin