Why is ASPNETDB.mdf created and how do I get rid of it?

My question is listed in the title to give some background.

I help clients use websites in ASP.net, and I do not want them to connect to this database. I would like to be able to use the site without creating this database.

Currently, I understand this more, but any suggestions on the sites you are looking at or information regarding this will be highly appreciated.

+4
source share
3 answers

Most of your configuration is stored in this database. It is designed to store all the complex data needed for membership and personalization.

You can specify a different database if you have one setting, but from the window Visual Studio uses this local file for the database.

I believe that web parts rely on database availability, so you need to save this database or follow the link above use a centralized database.

http://msdn.microsoft.com/en-us/library/879kf95c(VS.80).aspx

+5
source

If ASPNETDB.mdf does not match what your application requires, you can simply delete it from the "App_Data" folder, where this database file is probably located, and also delete the line on the Internet. configuration file that refers to it.

However, this database is necessary if you use membership services, as this is the place where all this information will be stored, as mentioned in David's answer.

Are you using one of the ASP.NET toolkits for this application? Please provide more details to help you better.

0
source

I know this is a very old post, but I had basically the same question: "Why is ASPNETDB.mdf created?" Since my site used a SQL database, ASPNETDB.mdf was not previously present. But then suddenly it appeared, and my whole site crashed at the placement. It was a little insidious, because everything worked perfectly in the development environment.

In my case, I wanted to get a list of user roles, and I added <roleManager enabled = "true" / "> to web.config. At that time I wasn’t connecting to create ASPNETDB.mdf. This function is SO post Role management function is not has been included has a good discussion on this topic.

But the fact is that when I turned on the role manager, the MVC infrastructure automatically created ASPNETDB.mdf, causing problems in the placement. I found another way to get roles without activating the default role manager, and my immediate problem was resolved.

I just wanted to add this post in case someone else was surprised by the sudden appearance of ASPNETDB.mdf. This is another way to show what the op question is about.

0
source

All Articles