Add support for MSBuildTask for VS2026#1583
Open
Kielek wants to merge 4 commits intonuke-build:developfrom
Open
Add support for MSBuildTask for VS2026#1583Kielek wants to merge 4 commits intonuke-build:developfrom
Kielek wants to merge 4 commits intonuke-build:developfrom
Conversation
…tion It keeps old behavior for BuildTools All new versions (2022+) for other editions will be taken from x64 folder.
…nstead of the year. It might required adjustments when new versions of VS will be released
Contributor
Author
|
quodana-scan is failing, due to following error: |
|
@matkoch Could we please merge this in? It's quite crucial for VS 2026 & C# 10 support |
Contributor
Author
|
Workaround. static void SupportVs2026IfAvailable()
{
// Typical installation folder: C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Current\Bin\amd64
// Waiting for official support in Nuke package https://github.com/nuke-build/nuke/pull/1583
string[] editions = ["Enterprise", "Professional", "Community", "Preview"];
foreach (var edition in editions)
{
var msBuildPath = Path.Combine(SpecialFolder(SpecialFolders.ProgramFiles).NotNull(),
$@"Microsoft Visual Studio\18\{edition}\MSBuild\Current\Bin\amd64\MSBuild.exe");
if (File.Exists(msBuildPath))
{
MSBuildPath = msBuildPath;
return;
}
}
}Works fine for OTel .NET Auto, couple last months: open-telemetry/opentelemetry-dotnet-instrumentation#4706 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1566
Add support for MSBuildTask for VS2026.
Now, there is no possibility to use 2026 without manually setting paths.
While reviewing, consider checking commit by commit. It brings explanations for the particular steps.
Needed for https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation
I confirm that the pull-request: