Wednesday 16 December 2015

Code First Problems and Fixes

Problem

After you delete a database and come across this problem

"Cannot attach the file  ERROR"  -    after Deleting MDF (database) file

Fix

  1. Remove old database connection string out of Web.Config
  2. Open the "Developer Command Propmpt for VisualStudio" under your start/programs menu.
  3. Run the following commands:
    sqllocaldb.exe stop v11.0
    sqllocaldb.exe delete v11.0

No comments:

Post a Comment