I have a project that uses .net core 2.0 with EntityFrameworkCore, Docker and SQL Server.
I can't get migrations to work. When I try
Add-Migration InitialCreate I get the following error:
Startup project 'docker-compose' is a Docker project. Select an ASP.NET Core Web Application as your startup project and try again.
I don't even have a asp.net web application but just a .net core console program. How do I enable migrations?
If I change the startup project to the console application I get:
Unable to create an object of type 'ApplicationDbContext'. Add an implementation of 'IDesignTimeDbContextFactory' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
The answer to the error
Startup project 'docker-compose' is a Docker project. Select an ASP.NET Core Web Application as your startup project and try again. Was to right click my actual code project in VisualStudio and click Set as Startup Project.
The solution file had marked the docker-compose project as the default project.