Skip to content

Commit 0f9c6bd

Browse files
committed
VS version folder changed tha pattern. Now it used internal version instead of the year.
It might required adjustments when new versions of VS will be released
1 parent fd409fe commit 0f9c6bd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

source/Nuke.Common/Tools/MSBuild/MSBuildToolPathResolver.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ private static Instance GetFromVs2017Instance(
6969
VisualStudioEdition edition,
7070
SpecialFolders specialFolder)
7171
{
72-
var versionDirectoryName = version.ToString().TrimStart("VS");
7372
var basePath = Path.Combine(
7473
EnvironmentInfo.SpecialFolder(specialFolder).NotNull(),
75-
$@"Microsoft Visual Studio\{versionDirectoryName}\{edition}\MSBuild\{GetVersionFolder(version)}\Bin");
74+
$@"Microsoft Visual Studio\{GetVisualStudioFolder(version)}\{edition}\MSBuild\{GetVersionFolder(version)}\Bin");
7675

7776
return new Instance(
7877
version,
@@ -114,6 +113,15 @@ private static SpecialFolders GetProgramFilesFolder(MSBuildVersion version, Visu
114113
};
115114
}
116115

116+
private static string GetVisualStudioFolder(MSBuildVersion version)
117+
{
118+
return version switch
119+
{
120+
MSBuildVersion.VS2026 => "18",
121+
_ => version.ToString().TrimStart("VS")
122+
};
123+
}
124+
117125
private static string GetVersionFolder(MSBuildVersion version)
118126
{
119127
return version switch

0 commit comments

Comments
 (0)