Cannot attach the file *.mdf as database

后端 未结 22 1916
猫巷女王i
猫巷女王i 2020-11-27 14:22

Basically I\'ve followed a tutorial and decided to delete the .mdf file afterwards.

Now whenever I try to run the application I get the following error

22条回答
  •  无人及你
    2020-11-27 14:54

    Ran into this issue. Caused in my case by deleting the .mdf while iispexress was still running and therefor still using the DB. Right click on iisexpress in system tray and click exit THEN delete the MDF to prevent this error from actually occurring.

    To fix this error simply within VS right click the App-Data folder add new item > SQL Server Database. Name: [use the database name provided by the update-database error] Click Add.

提交回复
热议问题