当我使用 Visual Studio 2012 打开 Visual Studio 2010 解决方案时,我收到以下消息:
在 Web.config 文件中,我更改了连接字符串
从:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename
=|DataDirectory|\databaseName.mdf;Integrated Security=True;User Instance=True"
到:
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename
=|DataDirectory|\databaseName.mdf;Integrated Security=True"
我无法连接数据库,当我运行应用程序时,我仍然收到一条错误消息:
An attempt to attach an auto-named database for file (FILE) failed.
A database with the same name exists, or specified file cannot be opened,
or it is located on UNC share.
The attempt to attach to the database failed with the following information:
Failed to generate a user instance of SQL Server due to a failure in starting
the process for the user instance. The connection will be closed.