Changement de la sortie des commandes dotnet workload
La sortie des commandes suivantes a été changée :
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é la sortie suivante :
- Lignes de limite de début et de fin pour l’analyse personnalisée afin de localiser le corps JSON.
- Tout autre texte de journalisation généré par les commandes pendant les opérations normales.
- Le corps JSON.
À présent, ces commandes génèrent uniquement la sortie du corps JSON.
Comportement précédent
Auparavant, les commandes dotnet workload
affectées produisaient une sortie similaire à la suivante 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 dotnet workload
affectées produisaient une sortie similaire à la suivante 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 Préversion 1
Type de changement cassant
Ce changement est un changement de comportement.
Raison du changement
Lorsque le format JSON est requis, de nombreux produits d’interface de ligne de commande génèrent uniquement une sortie JSON. Nous avons voulu suivre la procédure et générer également uniquement une sortie JSON. Avec ce changement, 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.
Action recommandée
Si votre code recherche le texte de limite de début et de fin suivant avant d’analyser le JSON, vous n’avez plus besoin de rechercher ces limites dans la sortie. Au lieu de cela, considérez la sortie de ces commandes comme étant directement le corps JSON.
==workloadListJsonOutputStart==/==workloadListJsonOutputEnd==
==allPackageLinksJsonOutputStart==/==allPackageLinksJsonOutputEnd==
==workloadRollbackDefinitionJsonOutputStart==/==workloadRollbackDefinitionJsonOutputEnd==
API affectées
N/A