Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

asp.net

My question is stated in the title, to give some background though.

I'm helping a customer use webparts within a ASP.net environment and I don't want them to get attached to this database. I'd like to be able to use the site without it creating this database.

I'm currently researching more into this, but any suggestions on sites to look at or information regarding this will be much appreciated.

like image 570
Eric Avatar asked Oct 07 '09 03:10

Eric


2 Answers

Most of your configuration is saved in this database. It's created to hold all the complex data that is necessary for membership and personalization to work.

You can point to a different database if you have one set up, but out of the box, Visual Studio uses this local file for the database.

I believe that web parts relies on having the database available, so you'll need to keep this database, or follow the link above to use a centralized database.

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

like image 168
David Avatar answered Nov 15 '22 08:11

David


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

In my case I wanted to get a list of user roles and I had added < roleManager enabled="true" /> in web.config. I didn't connect at the time that this would create ASPNETDB.mdf. This SO post The Role Manager feature has not been enabled has some good discussion regarding this topic.

But the point is that when I enabled the role manager, the MVC framework automatically created ASPNETDB.mdf, causing my problems at the hosting location. I found a different way to get the roles without activating the default role manager and my immediate problem was resolved.

I just wanted to add this post in the event someone else was surprised by the sudden appearance of ASPNETDB.mdf. This is another way it can show up, which is related to the op's question.

like image 28
Alan Avatar answered Nov 15 '22 08:11

Alan