通過關閉的Visual Studio 2013和定位這是WebApplication1 \ App_Data文件中的LocalDB的路徑解決了這個,有兩個文件ASPNET,WebApplication1-20140430012043.mdf和ASPNET -WebApplication1-20140430012043_log.ldf位於該文件夾中。
我修改了WebApplication1 \ App_Data的安全權限,以便SQL Server 2012連接到它時沒有問題。
然後我打開Microsoft SQL Server Management Studio並繼續附加數據庫,一旦數據庫連接到實例,我就備份了數據庫。接下來,我刪除了數據庫並進行了恢復,這次根據項目重新命名數據庫並重新定位mdf和ldf文件。
我再開我的項目在Visual Studio 2013和修改的Web.config:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-WebApplication1-20140430012043.mdf;Initial Catalog=aspnet-WebApplication1-20140430012043;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
到:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=MYSERVER;Initial Catalog=WebApplication1;Integrated Security=True" providerName="System.Data.SqlClient" />
然的項目,一切都很好。