Skip to content

Commit bc98723

Browse files
committed
Fix vswhere test
1 parent 857c2a8 commit bc98723

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/Microsoft.DotNet.Framework.Docker.Tests/SdkOnlyImageTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,16 @@ public void VerifyVsWhereOperability(ImageDescriptor imageDescriptor)
106106
JArray json = (JArray)JsonConvert.DeserializeObject(output);
107107

108108
Assert.Single(json);
109-
Assert.Equal(@"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools", json[0]["installationPath"]);
109+
110+
string expectedPath = imageDescriptor.OsVariant switch
111+
{
112+
// Visual Studio 2026/dev18 does not support Windows Server 2016.
113+
// See https://learn.microsoft.com/visualstudio/releases/2026/compatibility
114+
OsVersion.WSC_LTSC2016 => @"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools",
115+
_ => @"C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools",
116+
};
117+
118+
Assert.Equal(expectedPath, json[0]["installationPath"]);
110119

111120
// Get build version instead of a display version or semantic version because it's easier to parse and can
112121
// also seamlessly work with preview versions.

0 commit comments

Comments
 (0)