Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

EF Core 3 design time migrations broken by Microsoft.EntityFrameworkCore.Design DevelopmentDependency

$
0
0

Using IDesignTimeDbContextFactory to generate migrations at design time, running Package Manager Console commands add-migration, update-datebase, etc.

Microsoft.EntityFrameworkCore.Design now being a DevelopmentDependency type package, adds this to the .csproj where EFCore resides so that it cannot be referenced up the chain:

<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Nice idea, but this breaks running design time migration commands from PMC (which gives an error about the startup project needing Microsoft.EntityFrameworkCore.Design)

Design time migration tooling needs a reference to Microsoft.EntityFrameworkCore.Design but the default DevelopmentDependency  entries in the .csproj file appear to be blocking.

Temp solution - comment out the <PrivateAssets/> element in the .csproj file, then PMC migration commands work

<!-- <PrivateAssets>all</PrivateAssets> -->


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>