Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

Commit 7f4e1fb

Browse files
authored
Merge pull request #13 from schtritoff/hv_cluster_fix
ignore case when comparing keys in volumeMap dictionary
2 parents 22a72a3 + 0ff47c1 commit 7f4e1fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

HyperVBackup.Engine/BackupManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private void BackupSubset(IDictionary<string, string> vmNamesMapSubset, Options
111111

112112
IList<IVssWMComponent> components = new List<IVssWMComponent>();
113113
// key: volumePath, value: volumeName. These values are equivalent on a standard volume, but differ in the CSV case
114-
IDictionary<string, string> volumeMap = new Dictionary<string, string>();
114+
IDictionary<string, string> volumeMap = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
115115

116116
var wm = vss.WriterMetadata.FirstOrDefault(o => o.WriterId.Equals(hyperVwriterGuid));
117117
foreach (var component in wm.Components)
@@ -135,7 +135,7 @@ private void BackupSubset(IDictionary<string, string> vmNamesMapSubset, Options
135135
volumeName = volumePath;
136136
}
137137

138-
if (!volumeMap.ContainsKey(volumePath))
138+
if (!volumeMap.ContainsKey(volumePath)) // added StringComparer.InvariantCultureIgnoreCase to volumeMap Dictionary to fix duplicate Keys with different case
139139
volumeMap.Add(volumePath, volumeName);
140140
}
141141
}

0 commit comments

Comments
 (0)