Cannot attach the file *.mdf as database

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

    If you happen to apply migrations already this may fix it.

    Go to your Web.config and update your connection string based on your migration files.

    Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-GigHub-201802102244201.mdf;Initial Catalog=aspnet-GigHub-201802102244201;
    

    The datestrings should match the first numbers on your Migrations.

提交回复
热议问题