From 2931df37e70fd0a61d015237caac7527a61eb2f7 Mon Sep 17 00:00:00 2001 From: Bernhard Richter Date: Wed, 29 Nov 2017 21:34:58 +0100 Subject: [PATCH 1/2] Ensure that we don't load multiple compilation assemby versions --- src/OmniSharp.Script/ScriptProjectSystem.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/OmniSharp.Script/ScriptProjectSystem.cs b/src/OmniSharp.Script/ScriptProjectSystem.cs index ef8ca47ca8..a3caf9a9b8 100644 --- a/src/OmniSharp.Script/ScriptProjectSystem.cs +++ b/src/OmniSharp.Script/ScriptProjectSystem.cs @@ -112,10 +112,15 @@ public void Initalize(IConfiguration configuration) } else { + HashSet loadedFiles = new HashSet(); + foreach (var compilationAssembly in compilationDependencies.SelectMany(cd => cd.AssemblyPaths).Distinct()) { - _logger.LogDebug("Discovered script compilation assembly reference: " + compilationAssembly); - AddMetadataReference(commonReferences, compilationAssembly); + if (loadedFiles.Add(Path.GetFileName(compilationAssembly))) + { + _logger.LogDebug("Discovered script compilation assembly reference: " + compilationAssembly); + AddMetadataReference(commonReferences, compilationAssembly); + } } } From d9a6f70748053e13d80b9bda5896153e9c6b05ed Mon Sep 17 00:00:00 2001 From: Bernhard Richter Date: Wed, 29 Nov 2017 22:36:12 +0100 Subject: [PATCH 2/2] Make hashset for loaded compilation assemblies case insensitive --- src/OmniSharp.Script/ScriptProjectSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OmniSharp.Script/ScriptProjectSystem.cs b/src/OmniSharp.Script/ScriptProjectSystem.cs index a3caf9a9b8..fd7c2551f4 100644 --- a/src/OmniSharp.Script/ScriptProjectSystem.cs +++ b/src/OmniSharp.Script/ScriptProjectSystem.cs @@ -112,7 +112,7 @@ public void Initalize(IConfiguration configuration) } else { - HashSet loadedFiles = new HashSet(); + HashSet loadedFiles = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (var compilationAssembly in compilationDependencies.SelectMany(cd => cd.AssemblyPaths).Distinct()) {