Enable-Migrations - Cannot bind argument to parameter 'Path'

前端 未结 7 1608
青春惊慌失措
青春惊慌失措 2020-12-20 18:34

I\'m new to ASP.NET and am trying to set up a webAPI c# application with entity framework. But when I try to run the Enable-Migrations command on nuget-package-manager conso

相关标签:
7条回答
  • 2020-12-20 19:03

    Have you tried manually adding a database with the appropriate name to match the connection string in your config file?

    I had an identical error this afternoon. Adding the database manually fixed the issue and I have subsequently managed to add a migration which added a table.

    Following this I removed the Configuration file and the migrations (from the project's 'Migrations' folder), and deleted the database. When I subsequently ran update-database I got the more conventional responses:

    Checking if the context targets an existing database...

    Code First Migrations enabled for project MyProject.Domain

    I then ran 'add-migration Initial' and 'update-database'. This seeded me a new database. All good. Any updates from others about underlying story gratefully appreciated.

    0 讨论(0)
提交回复
热议问题