Cannot attach the file *.mdf as database

后端 未结 22 1866
猫巷女王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:30

    Take a look at this: Entity Framework don't create database

    I would try giving the database a different name. Sometimes you can run into problems with SQL Express when trying to create a database with the same name a second time. There is a way to fix this using SQL Server Management Studio but it's generally easier to just use a different database name.

    Edit This answer was accepted because it confirms the bug and the workaround used by OP (renaming database could help). I totally agree that renaming the database is not really an acceptable way, and does not totally solve the issue. Unfortunatly I didn't check the other ways to really solve it in SSMS.

提交回复
热议问题