Skip to content

Conversation

@Forgind
Copy link
Contributor

@Forgind Forgind commented Aug 9, 2024

Fixes #42581

dotnet workload list has a special check to ensure that if a global.json file exists that specifies a particular workload set, then that workload set is installed. If not, it informs the user that they should do that first.

dotnet workload --info did not. The result was that it would give an ugly error with a stack trace.

This gives it the clean error message.

The bug didn't mention this, but I believe dotnet --info is also broken in the same case. This resolves that as well.

@ghost ghost added Area-Workloads untriaged Request triage from a team member labels Aug 9, 2024
workloadInfoHelper ??= new WorkloadInfoHelper(parseResult != null ? parseResult.HasOption(SharedOptions.InteractiveOption) : false);
reporter ??= Utils.Reporter.Output;
var globalJsonInformation = workloadInfoHelper.ManifestProvider.GetGlobalJsonInformation();
if (globalJsonInformation?.WorkloadVersionInstalled == false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably don't need the == false,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

globalJsonInformation could be null, and if not, WorkloadVersionInstalled could be true or false, so this is really a bool?, hence the == false.

@marcpopMSFT marcpopMSFT merged commit a5fca69 into dotnet:main Aug 13, 2024
@dsplaisted
Copy link
Member

/backport to release/9.0.1xx

@github-actions
Copy link
Contributor

Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/10950545869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Workloads untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NETSDKE2E][Workload Sets] With manifest mode and workload installed, Unhandled exception occurs when running dotnet workload --info using global.json

4 participants