diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 35ecc269ac..0a749a7c3b 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -435,7 +435,7 @@ public virtual ConcurrentDictionary install_run(Chocolate uninstallSuccessAction: null, addUninstallHandler: true); - var originalConfig = config; + var originalConfig = config.deep_copy(); foreach (string packageName in packageNames.or_empty_list_if_null()) { @@ -614,7 +614,7 @@ public virtual ConcurrentDictionary upgrade_run(Chocolate set_package_names_if_all_is_specified(config, () => { config.IgnoreDependencies = true; }); config.IgnoreDependencies = configIgnoreDependencies; - var originalConfig = config; + var originalConfig = config.deep_copy(); foreach (string packageName in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null()) { @@ -890,7 +890,7 @@ public virtual ConcurrentDictionary get_outdated(Chocolat set_package_names_if_all_is_specified(config, () => { config.IgnoreDependencies = true; }); var packageNames = config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null().ToList(); - var originalConfig = config; + var originalConfig = config.deep_copy(); foreach (var packageName in packageNames) { @@ -1357,7 +1357,7 @@ public virtual ConcurrentDictionary uninstall_run(Chocola config.ForceDependencies = false; }); - var originalConfig = config; + var originalConfig = config.deep_copy(); foreach (string packageName in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null()) {