Remove PrivateAssets="All" for EF Core. Design dependency in MS.VS.Web.CG.EFCore package
See original GitHub issueMaking the Microsoft.EntityFrameworkCore.Design
package a private dependency has an unfortunate side effect:
https://github.com/aspnet/Scaffolding/blob/dev/src/VS.Web.CG.EFCore/VS.Web.CG.EFCore.csproj#L20
Scaffolding fails if the user project has a lower version of Microsoft.EntityFrameworkCore.Design
than what was used to build the scaffolding packages.
In the below csproj, Microsoft.AspNetCore.All
package has Microsoft.EntityFrameworkCore.Design
at version 2.0.1 whereas Microsoft.VisualStudio.Web.CodeGeneration.Design
was built with version 2.0.2
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
</ItemGroup>
</Project>
The user would see an error while scaffolding:
Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.2.0, Culture=neutral, PublicKeyToken=...'. The located assembly's manifest definition does not match the assembly reference.
The workaround for the user would be to update the Microsoft.AspNetCore.All
package to the latest 2.0.x version.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
What are the correct settings for EFCore.Design package in ...
Just remove both the privateassests and includeassests tags.
Read more >Design-time services - EF Core
Design is a DevelopmentDependency package. This means that the dependency won't flow transitively into other projects, and that you cannot, by ...
Read more >How to get EF Core - NuGet Package
Hit return, and the installation process should start. Command Line Tools. You can use the .NET Core command line tools to install Entity...
Read more >Install entity framework core in visual studio - YouTube
In the dependencies you will find the Entity Framework Core nuget packages already ... Relational package has a dependency on Microsoft.
Read more >Install Entity Framework Core
Learn how to install and use Entity Framework Core in your application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have cleared the milestone.
@Eilon - We will triage this in the next Scaffolding triage.
Since 3.0 version does not support .NET Framework, this is not an issue any more. Closing.