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.

Microsoft.VisualStudio.Web.CodeGeneration.Design causes package downgrade error NU1605 for Microsoft.NETCore.App

See original GitHub issue

Microsoft.VisualStudio.Web.CodeGeneration.Design has Microsoft.NETCore.App listed in its nuspec dependencies. This causes issues when the .NET Core SDK picks an implicit reference to Microsoft.NETCore.App that is lower than what the .Design package depends on.

Repro: Create app with the 2.0.0 SDK. Add or upgrade Microsoft.VisualStudio.Web.CodeGeneration.Design to 2.0.1 Restore.

Result:

error NU1605: Detected package downgrade: Microsoft.NETCore.App from 2.0.3 to 2.0.0. Reference the package directly from the project to select a different version.
 WebApplication1 (>= 1.0.0) -> Microsoft.VisualStudio.Web.CodeGeneration.Design (>= 2.0.1) -> Microsoft.NETCore.App (>= 2.0.3)

Workarounds:

  1. Upgrade Microsoft.NETCore.App (recommended)
<PropertyGroup>
  <RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
</PropertyGroup>
  1. Suppress NU1605 (may hide other issues)
<PropertyGroup>
  <NoWarn>$(NoWarn);NU1605</NoWarn>
</PropertyGroup>

Recommendation: We should remove Microsoft.NETCore.App from the nuspec dependencies and rely on the project to determine the runtime version use to launch dotnet-aspnet-codegenerator-design.exe

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mnmrcommented, Jan 17, 2018

@natemcmaster It was indeed a PackageReference, thanks.

0reactions
natemcmastercommented, Jan 17, 2018

@mmr is your reference to Microsoft.VisualStudio.Web.CodeGeneration.Tools a DotNetCliToolReference or a PackageReference? It should be the former.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet Warning NU1605
Detected package downgrade: 'PackageB' from 4.0.0 to 3.5.0. Reference the package directly from the project to select a different version.
Read more >
Error NU1605 Detected package downgrade
Something that I've run into that causes this error is having multiple references to the same package in one or more .csproj files....
Read more >
Microsoft.VisualStudio.Web.CodeGeneration.Design ...
Microsoft.VisualStudio.Web.CodeGeneration.Design causes package downgrade error NU1605 for Microsoft.NETCore.App #645.
Read more >
[NU1605] Detected package downgrade: … Reference the ...
For me the Solution it happened with had a number of projects, it also had a packages folder. The first step was to...
Read more >
Unable to update to .Net 6 in UI for ASP.NET Core
Error NU1605 Detected package downgrade: Microsoft.CodeAnalysis.CSharp from4.0.0-6.final to 3.8.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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