czwartek, 16 marca 2017

#Small tips - Cannot attach the file (Entity Framework)

Hi, today I had got problem after deleted my database mdf file from catalog App_Data.
I want to create new database by using update-database  command in Package Manager Console (in Visual Studio).

So if you get this error and you are using sqllocaldb as your database for ASP.NET MVC project:

You need to open Developer Command Prompt for VS2015 (enter name in search box of your Windows system)

Then run the following commands:

sqllocaldb.exe stop

And next

sqllocaldb.exe delete

After this your update-database should work property.

Brak komentarzy:

Prześlij komentarz