From 1b2e3d31c74e16450feb6563739779075a656ee8 Mon Sep 17 00:00:00 2001
From: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Date: Thu, 13 Nov 2025 13:55:38 +0000
Subject: [PATCH 1/3] Use tryGetVsInstallDir in VsMocks.fs
---
vsintegration/tests/Salsa/VsMocks.fs | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/vsintegration/tests/Salsa/VsMocks.fs b/vsintegration/tests/Salsa/VsMocks.fs
index 5189b7faec5..12108b08421 100644
--- a/vsintegration/tests/Salsa/VsMocks.fs
+++ b/vsintegration/tests/Salsa/VsMocks.fs
@@ -1640,6 +1640,7 @@ module internal VsActual =
open System.IO
open System.ComponentModel.Composition.Hosting
open System.ComponentModel.Composition.Primitives
+ open FSharp.Test.VSInstallDiscovery
open Microsoft.VisualStudio.Text
open Microsoft.VisualStudio.Threading
@@ -1651,15 +1652,18 @@ module internal VsActual =
member public _.JoinableTaskContext : JoinableTaskContext = jtc
let vsInstallDir =
- // use the environment variable to find the VS installdir
- let vsvar =
- let var = Environment.GetEnvironmentVariable("VS170COMNTOOLS")
- if String.IsNullOrEmpty var then
- Environment.GetEnvironmentVariable("VSAPPIDDIR")
- else
- var
- if String.IsNullOrEmpty vsvar then failwith "VS170COMNTOOLS and VSAPPIDDIR environment variables not found."
- Path.Combine(vsvar, "..")
+ match tryGetVSInstallDir () with
+ | Some dir -> dir
+ | None ->
+ // Fallback to legacy behavior for backward compatibility
+ let vsvar =
+ let var = Environment.GetEnvironmentVariable("VS170COMNTOOLS")
+ if String.IsNullOrEmpty var then
+ Environment.GetEnvironmentVariable("VSAPPIDDIR")
+ else
+ var
+ if String.IsNullOrEmpty vsvar then failwith "VS170COMNTOOLS and VSAPPIDDIR environment variables not found."
+ Path.Combine(vsvar, "..")
let CreateEditorCatalog() =
let thisAssembly = Assembly.GetExecutingAssembly().Location
From 7bce78d8d31c9ab17609ea21ba2a8140a6782607 Mon Sep 17 00:00:00 2001
From: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Date: Thu, 13 Nov 2025 14:29:37 +0000
Subject: [PATCH 2/3] Add project reference to test utils
---
vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 1 +
1 file changed, 1 insertion(+)
diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
index f7410214430..390088dfd47 100644
--- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
+++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
@@ -39,6 +39,7 @@
+
From 391bcd21ba1b0df8186685ae3d14f4a4fa098def Mon Sep 17 00:00:00 2001
From: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Date: Thu, 13 Nov 2025 16:04:08 +0000
Subject: [PATCH 3/3] Bump version of CodeAnalysis package for vs tests
---
eng/Versions.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 402c63052d6..99c05d2ed5f 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -102,7 +102,7 @@
2.0.28
- 4.14.0
+ 5.0.0-2.25480.7
$(MicrosoftVisualStudioShellPackagesVersion)