ASP.NET: Adding Membership to an mdf file

In case you need to add Membership to an *.mdf file you need to use the tool: aspnet_regsql.exe.

This tool can be found in:

C:\WINDOWS\Microsoft.NET\Framework\<versionNumber>\

In my case it was:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\

Now getting the tool working with an *.mdf file (MyData.mdf) should be done like this:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regsql.exe -C "Data Source=
.\SQLEXPRESS;Integrated Security=True;User Instance=True" -d "C:\Users\Teusje\do
cuments\visual studio 2010\Projects\MySite1\MySite1\App_Data\MyData.mdf" -A all

Start adding the following features:
Membership
Profile
RoleManager
Personalization
SqlWebEventProvider

................

Finished.

C:\Windows\Microsoft.NET\Framework\v4.0.30319>

More information about can be found here and here (msdn).

Enjoy ;)

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s