Skip to content

Commit

Permalink
Disabling change wave should only apply to standalone msbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Jan 25, 2022
1 parent 098f60f commit 9c2ad9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 11 additions & 0 deletions src/OmniSharp.Host/MSBuild/Discovery/MSBuildLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public void RegisterInstance(MSBuildInstance instance)

RegisteredInstance = instance ?? throw new ArgumentNullException(nameof(instance));

if (instance.DiscoveryType == DiscoveryType.StandAlone)
{
// MSBuild began relying on the Microsoft.IO.Redist library which does not work
// on MacOS or Linux platforms. Disabling the 17.0 feature wave opts us in to the
// earlier behavior of using System.IO.

// This issue only affects the MSBuild tools shipped with O# as Mono does not ship
// with a version of MSBuild that includes this change.
Environment.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", "17.0");
}

if (instance.SetMSBuildExePathVariable)
{
var msbuildExePath = Path.Combine(instance.MSBuildPath, "MSBuild.exe");
Expand Down
5 changes: 0 additions & 5 deletions src/OmniSharp.MSBuild/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ public ProjectManager(
{
_workspace.AddWaitForProjectModelReadyHandler(WaitForProjectModelReadyAsync);
}

// MSBuild began relying on the Microsoft.IO.Redist library which does not work
// on MacOS or Linux platforms. Disabling the 17.0 feature wave opts us in to the
// earlier behavior of using System.IO.
Environment.SetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION", "17.0");
}

private async Task WaitForProjectModelReadyAsync(string documentPath)
Expand Down

0 comments on commit 9c2ad9f

Please sign in to comment.