Wallace B. McClure
Wallace B. McClure

Reputation: 1555

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

Upvotes: 5

Views: 4368

Answers (5)

probity
probity

Reputation: 209

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.

Upvotes: 2

Armando Pitotti
Armando Pitotti

Reputation: 111

in .csproj file you can add:

<ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
</ItemGroup>

<ItemGroup>
    <DotNetCliToolReference 
    Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />

Upvotes: 0

Federico
Federico

Reputation: 1731

As mentioned in the links above another options is to add

<NoWarn>NU1605</NoWarn>

To element PropertyGroup

Upvotes: 2

Nads
Nads

Reputation: 11

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.

Upvotes: 1

Wallace B. McClure
Wallace B. McClure

Reputation: 1555

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.

Upvotes: 4

Related Questions