version = new Version (version_info.Name.Split (
new char [] {'_'}, StringSplitOptions.RemoveEmptyEntries) [0]);
- if (!gac.ContainsKey (assembly_info.Name))
- gac.Add (assembly_info.Name, new Dictionary <Version, string> ());
- gac [assembly_info.Name].Add (version, file);
+ Dictionary<Version, string> assembliesByVersion = new Dictionary <Version, string> ();
+ if (!gac.TryGetValue (assembly_info.Name, out assembliesByVersion)) {
+ assembliesByVersion = new Dictionary <Version, string> ();
+ gac.Add (assembly_info.Name, assembliesByVersion);
+ }
+
+ string found_file;
+ if (assembliesByVersion.TryGetValue (version, out found_file) &&
+ File.GetLastWriteTime (file) <= File.GetLastWriteTime (found_file))
+ // Duplicate found, take the newer file
+ continue;
+
+ assembliesByVersion [version] = file;
}
}
}
+2009-03-19 Ankit Jain <jankit@novell.com>
+
+ Fix bugs #323833 and #484384.
+ * AssemblyResolver.cs (GatherGacAssemblies): Handle duplicate entries.
+ These seem to be old copies of the assemblies with old keys. Pick
+ the one with the latest timestamp.
+
2009-03-03 Ankit Jain <jankit@novell.com>
Fix bug #480856.