question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove PrivateAssets="All" for EF Core. Design dependency in MS.VS.Web.CG.EFCore package

See original GitHub issue

Making 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.

cc @seancpeters @vijayrkn

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
vijayrkncommented, Oct 18, 2018

I have cleared the milestone.

@Eilon - We will triage this in the next Scaffolding triage.

0reactions
vijayrkncommented, Nov 9, 2019

Since 3.0 version does not support .NET Framework, this is not an issue any more. Closing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found