Detected package downgrade warning (dotnet core, vs 2017)

后端 未结 19 1418
梦如初夏
梦如初夏 2021-02-01 11:53

I have just updated all my nuget packages for my solution (dotnet core 1.1 project).

I am now getting the following warnings and I don\'t really know what they mean.

相关标签:
19条回答
  • 2021-02-01 12:32

    In my case neither of those properties were set in my csproj files.

    I had to tell VS to update those packages via NuGet.

    The warnings appeared for me after resolving the warning for explicit reference to implicit dependency .NETCore.App after moving from 1.0 to 1.1.

    UPDATE 21/09/17

    This also seems to affect upgrades to 2.0, the resolution is the same. Update those packages manually with NuGet. Thanks to IbrarMumtaz for pointing this out!

    0 讨论(0)
  • 2021-02-01 12:35

    This situation occurred to me after opening an existing solution but instead of Warnings, they were Errors.

    I opened the YourAwesomeApp.csproj file and went through the "Detected package downgrade" errors one-by-one and manually changed the version of that line item from the existing version to the specified version that was shown in the error itself.

    For example, if the Error says downgrade detected "SqlServer 1.0.4 -> 1.0.3" then find the line for package SqlServer and edit the version from 1.0.3 to 1.0.4.

    Those errors should disappear after building the project.

    The downside to this that I only had 5 errors this time but what if another person's project contained say 50 such errors. Then that person's task of manually editing those lines would be very tedious and time-consuming.

    0 讨论(0)
  • 2021-02-01 12:35

    I just recently came across this issue and updating the NuGet packages was what worked for me.

    0 讨论(0)
  • 2021-02-01 12:36

    For me it was caused by referencing a project using a specified version of Microsoft.AspNetCore.App where my project did not :

    My project :

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.App"/>
      </ItemGroup>
    

    referenced project :

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.2" />
      </ItemGroup>
    

    Fix (My project) :

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.2" />
      </ItemGroup>
    
    0 讨论(0)
  • 2021-02-01 12:37

    Try removing:

    <IsPackable>false</IsPackable>
    

    from your project file - this is what worked for me!

    If you are still left with NU1605 Error code you can ignore it by adding the following to your project file:

    <PropertyGroup>
        <NoWarn>NU1605</NoWarn>
    </PropertyGroup>
    
    0 讨论(0)
  • 2021-02-01 12:37

    I was trying to upgrade Microsoft.AspNetcore.MVC to Version 2+. The solution for me was to upgrade all of the other dependencies first to 2+, then finally upgrade .MVC.

    0 讨论(0)
提交回复
热议问题