Megosztás a következőn keresztül:


dotnet workload parancsok kimenetének módosítása

A következő parancsok kimenetében változás történt:

  • dotnet workload list --machine-readable
  • dotnet workload install --print-download-link-only
  • dotnet workload update --print-download-link-only
  • dotnet workload update --print-rollback

Korábban az érintett parancsok a következőket eredményezték:

  • Az egyéni elemzés kezdő és záró határvonalai a JSON-törzs megkereséséhez.
  • Minden más naplózási szöveg, amelyet a parancsok a normál művelet során kimeneteltek.
  • A JSON test.

Ezek a parancsok most csak a JSON-törzset kimenetelik.

Előző viselkedés

Korábban az érintett dotnet workload parancsok a következőhöz hasonló kimenetet hoztak létre a parancshoz 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==

Új viselkedés

A .NET 9-től kezdődően az érintett dotnet workload parancsok a következőhöz hasonló kimenetet hoztak létre a parancshoz 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"}]}

Bevezetett verzió

.NET 9 előzetes verzió 1

A kompatibilitástörő változás típusa

Ez a változás viselkedésbeli változás.

A változás oka

A JSON kérése esetén számos CLI-termék csak JSON-t ad ki. Követni akartuk az öltönyt, és csak JSON-t akartunk kihozni. Ezzel a módosítással az eszközökben ezeket a parancsokat használó ügyfelek nem igényelnek egyéni elemzést. Ezeknek a parancsoknak a kimenetét közvetlenül egy JSON-elemzőbe helyezheti a közbenső elemzési logika helyett.

Ha a kód a JSON elemzése előtt a következő kezdő és záró határszöveget keresi, akkor már nem kell a kimenetben keresnie ezekre a határokra. Ehelyett tekintsük úgy, hogy a parancsok kimenete közvetlenül a JSON-törzs.

  • ==workloadListJsonOutputStart==/==workloadListJsonOutputEnd==
  • ==allPackageLinksJsonOutputStart==/==allPackageLinksJsonOutputEnd==
  • ==workloadRollbackDefinitionJsonOutputStart==/==workloadRollbackDefinitionJsonOutputEnd==

Érintett API-k

n/a