Partager via


Changement de la sortie des commandes dotnet workload

Il y a eu une modification dans la sortie des commandes suivantes :

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

Auparavant, les commandes affectées ont généré les éléments suivants :

  • Lignes de limite de début et de fin pour l’analyse personnalisée pour localiser le corps JSON.
  • Tout autre texte de journalisation généré par les commandes pendant l’opération normale.
  • Le corps JSON.

À présent, ces commandes génèrent uniquement le corps JSON.

Comportement précédent

Auparavant, les commandes affectées dotnet workload produisaient une sortie similaire à ce qui suit pour la commande 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==

Nouveau comportement

À compter de .NET 9, les commandes affectées dotnet workload ont produit une sortie similaire à ce qui suit pour la commande 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"}]}

Version introduite

.NET 9 Preview 1

Type de changement cassant

Ce changement est un changement de comportement.

Raison de la modification

Lorsque JSON est demandé, de nombreux produits CLI génèrent uniquement le JSON de sortie. Nous voulions suivre la procédure et également générer uniquement JSON. Avec cette modification, les clients qui utilisent ces commandes dans leurs outils ne nécessitent pas d’analyse personnalisée. Vous pouvez diriger la sortie de ces commandes directement dans un analyseur JSON au lieu d’une logique d’analyse intermédiaire.

Si votre code recherche le texte de limite de début et de fin suivant avant d’analyser JSON, vous n’avez plus besoin de rechercher la sortie pour ces limites. Au lieu de cela, considérez que la sortie de ces commandes est directement le corps JSON.

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

API affectées

N/A