Microsoft.VisualStudio.Web.CodeGeneration.Design causes package downgrade error NU1605 for Microsoft.NETCore.App
See original GitHub issueMicrosoft.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:
- Upgrade Microsoft.NETCore.App (recommended)
<PropertyGroup>
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
</PropertyGroup>
- 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:
- Created 6 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
@natemcmaster It was indeed a PackageReference, thanks.
@mmr is your reference to Microsoft.VisualStudio.Web.CodeGeneration.Tools a DotNetCliToolReference or a PackageReference? It should be the former.