Package upgrade not detected if targeting net10.0 for "in-box" dependency

オープン
#685 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
tooling

調査の方向性

Reproduce with the two-line project in the issue: a net6.0 project referencing System.Text.Json 6.0.0 is flagged, but the same project targeting net10.0 is not. Start by finding where dotnet-outdated decides whether a package reference is in-box or outdated for the target framework. The issue suggests NuGet pruning and NU1510 as the cause. Done means the net10.0 case reports System.Text.Json as outdated, with a test covering it.

索引モデルが issue の本文から書いたものです。

説明

Consider the following project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.Text.Json" Version="6.0.0" />
  </ItemGroup>
</Project>

Running dotnet outdated gives the following output:

❯ dotnet outdated
Discovering projects...
Analyzing project(s)...
Analyzing dependencies...
» _scratch
  [net6.0]
  System.Text.Json  6.0.0 -> 10.0.0

Version color legend:
<red>   : Major version update or pre-release version. Possible breaking changes.
<yellow>: Minor version update. Backwards-compatible features added.
<green> : Patch version update. Backwards-compatible bug fixes.

You can upgrade packages to the latest version by passing the -u or -u:prompt option.
Elapsed: 00:00:02.8920607

However, after the target framework is updated to net10.0, the upgrade is no longer detected:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
-   <TargetFramework>net6.0</TargetFramework>
+   <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.Text.Json" Version="6.0.0" />
  </ItemGroup>
</Project>
❯ dotnet outdated
Discovering projects...
Analyzing project(s)...
Analyzing dependencies...
No outdated dependencies were detected
Elapsed: 00:00:01.1248270

My guess is that this is related to NuGet package pruning and NU1510. While the reference is indeed redundant, it still makes sense to detect it is outdated.

主要言語
C#
スター
1.7k
フォーク
172
平均マージ
1日 19時間
マージ済み PR(30日)
39

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet-outdated/dotnet-outdated のほかの issue

dotnet-outdated/dotnet-outdated の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。