次のコマンドの出力に変更が加えられます。
dotnet workload list --machine-readable
dotnet workload install --print-download-link-only
dotnet workload update --print-download-link-only
dotnet workload update --print-rollback
以前は、影響を受けるコマンドによって次の出力が出力されました。
- JSON 本文を見つけるためのカスタム解析の開始と終了の境界線。
- 通常の操作中にコマンドが出力したその他のログ テキスト。
- JSON 本文。
次に、これらのコマンドは JSON 本文のみを出力します。
以前の動作
以前は、影響を受ける dotnet workload
コマンドは、コマンド dotnet workload list --machine-readable
に対して次のような出力を生成しました。
Failed to update the advertising manifest microsoft.net.sdk.tvos: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.sdk.android: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.sdk.maui: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.workload.emscripten: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.sdk.macos: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.sdk.ios: Unable to load the service index for source https://REDACTED/index.json..
Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: Unable to load the service index for source https://REDACTED/index.json..
==workloadListJsonOutputStart==
{"installed":["macos","ios"],"updateAvailable":[{"existingManifestVersion":"12.0.101-preview.10.249","availableUpdateManifestVersion":"12.0.101-preview.10.251","description":".NET SDK Workload for building macOS applications.","workloadId":"macos"},{"existingManifestVersion":"15.0.101-preview.9.31","availableUpdateManifestVersion":"15.0.101-preview.10.251","description":".NET SDK Workload for building iOS applications.","workloadId":"ios"}]}
==workloadListJsonOutputEnd==
新しい動作
.NET 9 以降では、影響を受ける dotnet workload
コマンドによって、コマンド dotnet workload list --machine-readable
に対して次のような出力が生成されました。
{"installed":["macos","ios"],"updateAvailable":[{"existingManifestVersion":"12.0.101-preview.10.249","availableUpdateManifestVersion":"12.0.101-preview.10.251","description":".NET SDK Workload for building macOS applications.","workloadId":"macos"},{"existingManifestVersion":"15.0.101-preview.9.31","availableUpdateManifestVersion":"15.0.101-preview.10.251","description":".NET SDK Workload for building iOS applications.","workloadId":"ios"}]}
導入されたバージョン
.NET 9 Preview 1
破壊的変更の種類
この変更は 動作の変更です。
変更の理由
JSON が要求されると、多くの CLI 製品は JSON のみを出力します。 それに従い、JSON のみを出力したいと考えました。 この変更により、ツールでこれらのコマンドを使用するお客様は、カスタム解析を必要としません。 これらのコマンドの出力は、中間解析ロジックではなく、JSON パーサーに直接パイプできます。
推奨されるアクション
JSON を解析する前にコードで次の開始境界と終了境界テキストを検索する場合は、これらの境界の出力を検索する必要がなくなりました。 代わりに、これらのコマンドの出力を JSON 本文に直接指定することを検討してください。
==workloadListJsonOutputStart==/==workloadListJsonOutputEnd==
==allPackageLinksJsonOutputStart==/==allPackageLinksJsonOutputEnd==
==workloadRollbackDefinitionJsonOutputStart==/==workloadRollbackDefinitionJsonOutputEnd==
影響を受ける API
なし
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET