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
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.