Share via


dotnet workload 명령 출력 변경

다음 명령의 출력이 변경되었습니다.

  • 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 미리 보기 1

호환성이 손상되는 변경의 형식

이 변경 사항은 동작 변경입니다.

변경 이유

JSON이 요청되면 많은 CLI 제품은 JSON만 출력합니다. 이를 따르고 JSON만 출력하려고 했습니다. 이번 변경으로 인해 도구에서 이러한 명령을 사용하는 고객은 사용자 지정 구문 분석이 필요하지 않습니다. 중간 구문 분석 논리 대신 이러한 명령의 출력을 JSON 파서로 직접 파이프할 수 있습니다.

코드가 JSON을 구문 분석하기 전에 다음 시작 및 끝 경계 텍스트를 검색하는 경우 더 이상 이러한 경계에 대한 출력을 검색할 필요가 없습니다. 대신 이러한 명령의 출력을 JSON 본문으로 간주합니다.

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

영향을 받는 API

N/A