Cannot attach the file ‘.mdf’ as database in MVC

Open the “Developer Command Propmpt for VisualStudio” under your “Start/Programs menu->All Programs->Visual Studio 2012->Visual Studio Tools”

Run the following commands:

sqllocaldb.exe stop v11.0

sqllocaldb.exe delete v11.0

Now execute update-database command from package manager console and it will create database for you without any obstacles.

发表评论

电子邮件地址不会被公开。 必填项已用*标注