5

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

Wallace B. McClure
  • 1,165
  • 1
  • 15
  • 31
  • Try to remove the package and then install it again. – LosManos Nov 20 '17 at 21:44
  • alas, that didn't help. I have uninstalled, now when I attempt to install again, I am getting a message of "blocked by project" Ugh – Wallace B. McClure Nov 20 '17 at 22:06
  • Does https://stackoverflow.com/questions/44026190/visual-studio-2017-cannot-update-microsoft-netcore-app-package-blocked-by-proj give a clue? – LosManos Nov 20 '17 at 22:08
  • Thanks for the suggestion. I had been through that question. :-) – Wallace B. McClure Nov 20 '17 at 22:20
  • and I am not quite sure what is happening, but I've gone through the project, uninstalled, reinstalled at various levels and now things are compiling and running. I can honestly say, I have no idea what fixed it. I am guessing that it was your pointing me to the csproj and my making some weird edits. Thanks. :-) – Wallace B. McClure Nov 20 '17 at 22:21
  • well, i should say that it works, but VS is still complaining about the same error. Interestingly, this was blocking VS from starting the project previously. It is working now. I have no idea why. :-/ – Wallace B. McClure Nov 20 '17 at 22:24
  • 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. :-) – Wallace B. McClure Nov 21 '17 at 01:32
  • Good thing you wrote about the solution. I suggest you write it down as the Answer. – LosManos Nov 21 '17 at 05:40
  • There was a popular (but plagiarized) answer to this question which copied a comment from a GitHub issue. It has now been deleted, but for posterity, here is the comment: https://github.com/aspnet/EntityFrameworkCore/issues/10457#issuecomment-348365091 – johnnyRose Apr 05 '18 at 13:39

5 Answers5

4

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.

Wallace B. McClure
  • 1,165
  • 1
  • 15
  • 31
2

As mentioned in the links above another options is to add

<NoWarn>NU1605</NoWarn>

To element PropertyGroup

Federico
  • 1,636
  • 2
  • 22
  • 24
2

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.

probity
  • 209
  • 1
  • 2
  • 7
1

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.

Nads
  • 11
  • 1
0

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" />