문제

I am trying to follow the tutorial http://www.asp.net/web-forms/tutorials/data-access/model-binding/retrieving-data.

When I am trying the update-database command in PM console, i get the following error.

Cannot attach the file 'D:\ASPdotNet\ContosoUniversity\ContosoUniversity\App_Data\ContosoUniversity.Models.SchoolContext.mdf' as database 'ContosoUniversity.Models.SchoolContext'.

올바른 솔루션이 없습니다

다른 팁

Just ran into the exact same issue. To resolve I used,

Open the "Developer Command Propmpt for VisualStudio" under your start/programs menu and run the following commands:

sqllocaldb.exe stop v11.0
sqllocaldb.exe delete v11.0

Rebuild the solution and try to update the database again.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top