Skip to content

Commit

Permalink
Workaround for issue with different versions of msbuild.
Browse files Browse the repository at this point in the history
  • Loading branch information
savpek committed Feb 18, 2019
1 parent da6089d commit 9cc6cb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"sdk": {
"version": "2.1.301"
}
}
20 changes: 7 additions & 13 deletions src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -213,21 +214,14 @@ private static bool TryGetAssemblyName(string assemblyPath, out AssemblyName ass

public ImmutableArray<MSBuildInstance> GetInstances()
{
var builder = ImmutableArray.CreateBuilder<MSBuildInstance>();
var result = _providers
.SelectMany(x => x.GetInstances())
.Where(x => x != null)
.OrderByDescending(x => x.Version)
.ToImmutableArray();

foreach (var provider in _providers)
{
foreach (var instance in provider.GetInstances())
{
if (instance != null)
{
builder.Add(instance);
}
}
}

var result = builder.ToImmutable();
LogInstances(result);

return result;
}

Expand Down

0 comments on commit 9cc6cb5

Please sign in to comment.