Skip to content

Commit

Permalink
Try start vs4mac with local dotnet
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Sep 3, 2021
1 parent 47de1f3 commit 85ce42d
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -322,27 +322,28 @@ void StartVisualStudioForDotNet6(string sln = "./Microsoft.Maui-net6.sln")
Information("This target should not run on CI.");
return;
}
if (!IsRunningOnWindows())
{
Information("This target is only supported on Windows.");
return;
}

bool includePrerelease = true;

if (!String.IsNullOrEmpty(vsVersion))
includePrerelease = (vsVersion == "preview");

var vsLatest = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = includePrerelease, });
if (vsLatest == null)
throw new Exception("Unable to find Visual Studio!");
if(localDotnet)
{
SetDotNetEnvironmentVariables();
SetEnvironmentVariable("_ExcludeMauiProjectCapability", "true");
}
if (IsRunningOnWindows())
{
bool includePrerelease = true;

StartProcess(vsLatest.CombineWithFilePath("./Common7/IDE/devenv.exe"), sln);
if (!String.IsNullOrEmpty(vsVersion))
includePrerelease = (vsVersion == "preview");

var vsLatest = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = includePrerelease, });
if (vsLatest == null)
throw new Exception("Unable to find Visual Studio!");

StartProcess(vsLatest.CombineWithFilePath("./Common7/IDE/devenv.exe"), sln);
}
else
{
StartProcess("open", new ProcessSettings{ Arguments = sln });
}
}

// NOTE: These methods work as long as the "dotnet" target has already run
Expand Down

0 comments on commit 85ce42d

Please sign in to comment.