mhinton
mhinton

Reputation: 1175

Can't Attach ASPNETDB.MDF on Vista

I can't connect to the ASPNETDB.MDF file in the App_Data that is created by the ASP.NET MVC Beta project from Visual Studio 2008 or SQL Management Studio 2008 Express on Vista. The project is in C:\Users\Matthew\Documents\Visual Studio 2008\Projects\MVCTest so the MDF file is in C:\Users\Matthew\Documents\Visual Studio 2008\Projects\MVCTest\MVCTest\App_Data.

When I try and connect to the database in the Visual Studio 2008 Server Explorer I get the following error message.

An attempt to attach an auto-named database for file C:\Users\Matthew\Documents\Visual Studio 2008\Projects\MVCTest\App_Data\ASPNETDB.MDF failed. A databse with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Upvotes: 0

Views: 1676

Answers (2)

mhinton
mhinton

Reputation: 1175

I am chalking this down to something weird with Vista. Instead of having asp.net create the Forms auth database automatically I ran aspnet_regsql -W and created the Forms auth database in my SQLEXPRESS 2008 instance. I can attach to that once in Visual Studio 2008 and Sql Management Studio Express 2008 without any problem.

Upvotes: 2

Matt Briggs
Matt Briggs

Reputation: 42238

First, check to see if you actually have another one attached to your sqlexpress instance. If you dont, go to the file, right-click, go to properties, then security, and check out what the permissions look like. If your user doesn't have read access, that would probably be the problem.

Upvotes: 0

Related Questions