Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.NETCore.App 2.0.3

I updated an asp.net core 2 app with updated nuget packages. Boom, my web app nolonger compiles. I get the error shown below. I tried to go in and manually change the versions by editing the csproj, but I seemed to be causing more harm than good. Anyone have an idea how to resolve this?

Severity Code Description Project File Line Suppression State 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. BWD.ASPNET.Core -> Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1 -> Microsoft.NETCore.App (>= 2.0.3) BWD.ASPNET.Core -> Microsoft.NETCore.App (>= 2.0.0) BWD.ASPNET.Core E:\BWDCore\BWD.ASPNET.Core\BWD.ASPNET.Core\BWD.ASPNET.Core.csproj 1

like image 216
Wallace B. McClure Avatar asked Nov 20 '17 21:11

Wallace B. McClure


4 Answers

What did work was removing the core nuget packages and then only adding back the .net core metapackages. Thanks to my buddy Shawn Wildermuth (and everyone) for the suggestion. :-)

I can't take credit for the answer. I am just reposting it here for anyone that might be wondering and find this via google. I also got some other suggestions, but none of them worked.

like image 195
Wallace B. McClure Avatar answered Oct 30 '22 03:10

Wallace B. McClure


As mentioned in the links above another options is to add

<NoWarn>NU1605</NoWarn>

To element PropertyGroup

like image 23
Federico Avatar answered Oct 30 '22 05:10

Federico


Try to add this line in the section PropertyGroup of your *.csproj file:

<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>

Don't forget to clean the project up.

I hope it will help you.

like image 2
probity Avatar answered Oct 30 '22 04:10

probity


I think Microsoft.EntityFrameworkCore.Tools.DotNet Version="2.0.1" has a dependency issue. It says it requires Microsoft.NETCore.App (>= 2.0.3).

We went back to Microsoft.EntityFrameworkCore.Tools.DotNet Version="2.0.0", and it all just worked.

like image 1
Nads Avatar answered Oct 30 '22 04:10

Nads