sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Outdated packages are wrongly displayed for given target framework

Open msmolka opened this issue 2 years ago • 3 comments

Describe the bug

using: dotnet list package --outdated --framework net6.0 shows packages versions that supported only by net7.0 target framework and not net6.0

To Reproduce

project with reference: <PackageReference Include="Ardalis.SmartEnum" Version="2.1.0" />

outdate will show:

[net6.0]:
Top-level Package Requested Resolved Latest
> Ardalis.SmartEnum 2.1.0 2.1.0 7.0.0 

7.0.0 is not compatible with net6

Further technical details

.NET SDK:
 Version:   7.0.102
 Commit:    4bbdd14480

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.102\

Host:
  Version:      7.0.2
  Architecture: x64
  Commit:       d037e070eb

msmolka avatar Feb 10 '23 13:02 msmolka

Can confirm it's quite annoying another example is Microsoft.AspNetCore.Mvc.Newtonsoft https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.NewtonsoftJson#dependencies-body-tab image

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>net6.0;net7.0</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.5" Condition=" '$(TargetFramework)' == 'net7.0' " />
    <PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.16" Condition=" '$(TargetFramework)' == 'net6.0' " />
  </ItemGroup>
</Project>
dotnet list package --outdate
   [net6.0]:
   Top-level Package                              Requested   Resolved   Latest
   > Microsoft.AspNetCore.Mvc.NewtonsoftJson                  6.0.16     7.0.5

   [net7.0]: No package updates available for this framework.

tebeco avatar May 22 '23 21:05 tebeco

System.ServiceModel.* v=6.0.0 are mistakenly listed for net48

minj avatar Jun 09 '23 07:06 minj

Any progress on this? It's happening for .NET 9 packages when on .NET 8.

CSharpFiasco avatar Jun 23 '25 14:06 CSharpFiasco

Hi there, any progress on this?

Because the results are just wrong and therefor can't be used.

Example:

{
      "path": "C:/../abc.csproj",
      "frameworks": [
        {
          "framework": "net9.0",
          "topLevelPackages": [
            {
              "id": "Microsoft.AspNetCore.Mvc.Testing",
              "requestedVersion": "9.0.11",
              "resolvedVersion": "9.0.11",
              "latestVersion": "10.0.0"
            }
          ]
        }
      ]
    }

twenzel avatar Nov 14 '25 05:11 twenzel