Skip to content

Commit 2ab2eff

Browse files
committed
Fix install with rollback
1 parent d0bf430 commit 2ab2eff

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ private void InstallWorkloadsWithInstallRecord(
216216
installer.InstallWorkloadManifest(manifestUpdate, context, offlineCache, rollback);
217217
}
218218

219+
if (usingRollback)
220+
{
221+
UpdateInstallState(true, manifestsToUpdate);
222+
}
223+
219224
_workloadResolver.RefreshWorkloadManifests();
220225

221226
installer.InstallWorkloads(workloadIds, sdkFeatureBand, context, offlineCache);
@@ -227,10 +232,6 @@ private void InstallWorkloadsWithInstallRecord(
227232
recordRepo.WriteWorkloadInstallationRecord(workloadId, sdkFeatureBand);
228233
}
229234

230-
if (usingRollback)
231-
{
232-
UpdateInstallState(true, manifestsToUpdate);
233-
}
234235
},
235236
rollback: () =>
236237
{
@@ -242,6 +243,9 @@ private void InstallWorkloadsWithInstallRecord(
242243
installer.GetWorkloadInstallationRecordRepository()
243244
.DeleteWorkloadInstallationRecord(workloadId, sdkFeatureBand);
244245
}
246+
247+
// Refresh the workload manifests to make sure that the resolver has the updated state after the rollback
248+
_workloadResolver.RefreshWorkloadManifests();
245249
});
246250

247251
}

0 commit comments

Comments
 (0)