Skip to content

Commit

Permalink
Update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Feb 28, 2024
1 parent bd6b3d0 commit 1dd1294
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions MSBuildSandbox.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
//using Microsoft.Build.BuildEngine;
Expand Down Expand Up @@ -50,10 +51,14 @@ public string GetMSbuildLocation ()
var path = Environment.GetEnvironmentVariable ("MSBuildExtensionsPath");
if (!string.IsNullOrEmpty (path))
return path;
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
if (RuntimeInformation.IsOSPlatform (OSPlatform.Windows)) {
return ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", ToolLocationHelper.CurrentToolsVersion);
}
return @"/usr/local/share/dotnet/sdk/8.0.100/";
else if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX))
return @"/usr/local/share/dotnet/sdk/8.0.100/";
else if (RuntimeInformation.IsOSPlatform (OSPlatform.Linux))
return @"/usr/share/dotnet/sdk/8.0.200/";
return ToolLocationHelper.GetPathToBuildToolsFile("MSBuild.dll", ToolLocationHelper.CurrentToolsVersion);
}

Project LoadProject (string source ) {
Expand Down

0 comments on commit 1dd1294

Please sign in to comment.