From 12a8505c1aeb926521d5d9d76ea43cf1cd1ce6a1 Mon Sep 17 00:00:00 2001 From: Forgind <12969783+Forgind@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:40:46 -0800 Subject: [PATCH] Swap lines --- .../dotnet-workload/restore/WorkloadRestoreCommand.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs index 94c40d95dc4c..41fa1049bf3b 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/restore/WorkloadRestoreCommand.cs @@ -50,10 +50,12 @@ public override int Execute() recorder.Run(() => { - // First update manifests and install a workload set as necessary + // First discover projects. This may return an error if no projects are found, and we shouldn't delay until after Update if that's the case. + var allProjects = DiscoverAllProjects(Directory.GetCurrentDirectory(), _slnOrProjectArgument).Distinct(); + + // Then update manifests and install a workload set as necessary new WorkloadUpdateCommand(_result, recorder: recorder, isRestoring: true).Execute(); - var allProjects = DiscoverAllProjects(Directory.GetCurrentDirectory(), _slnOrProjectArgument).Distinct(); List allWorkloadId = RunTargetToGetWorkloadIds(allProjects); Reporter.WriteLine(string.Format(LocalizableStrings.InstallingWorkloads, string.Join(" ", allWorkloadId)));