Search code examples
c#asp.netweb-configmembership

Using Microsoft Membership Provider Outside of ASP.NET


I'm trying to integrate with an already existing user base. They are using the membership providers, but my application is multiplayer for a mobile game. I guess my question is in two parts.

Can I use the membership provider classes in a non-asp.net application?

And if I can, how do I setup a Web.config file when not in a web application project?


Solution

  • You can definitely use WebSecurity in other places, it is just a class after all. And there is nothing magical about web.config, asp.net is basically taking those attributes inside web.config and feed them to appropriate classes. Something like WebSecurity.InitializeDatabaseConnection . So you can just hard code them in or make your own config file to store those info.