Question

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.

1
3
2/3/2018 10:41:01 PM

Popular Answer

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.

0
12/9/2019 5:38:26 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow