Skip to content

dotnet ef migrations fails with Directory.Build.props #23691

@eddieparker

Description

@eddieparker

Using the attached zip file, I can't get dotnet ef migrations add InitialCreate to work with the given Directory.Build.props. I've tried various incantations of --msbuildprojectextensionspath and they all yield the following error:

D:\dev\personal\csharpsandbox\csharpsandbox.csproj : error MSB4057: The target "GetEFProjectMetadata" does not exist in the project.
Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option.

If you delete the Directory.Build.props file the sample builds fine however.

Include provider and version information

EF Core version: 5.0.1
Database provider: Sqlite
Target framework: .netcore 3.1
Operating system: Windows
IDE: VS2019 16.8.3

EFMigrateTest.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions