Unable to retrieve project metadata. Ensure it's an MSBuild-based .NET Core project. (Migrations)

.net c# entity-framework entity-framework-core

Question

I have a project with this structure enter image description here

TooSeeWeb.Infrastructure is for migrations.

When I try to run migrations with this command

dotnet ef migrations add ExampleMigration -s ..\TooSeeWeb

I have this error

Unable to retrieve project metadata. Ensure it's an MSBuild-based .NET Core project. If you're using custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option

How I can fix this?

1
2
2/27/2019 6:41:48 PM

Popular Answer

You have to point to your web project

 dotnet ef --startup-project ../TooSeeWeb migrations add MigrationName -c NameOfYourDBContext

More details about multi project you can find https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/projects

0
5/30/2019 4:32:15 PM


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