Skip to content

Commit 1a955d1

Browse files
xperiandriclaude
andcommitted
Add -InstalledRoslyn to take the Roslyn version from the installed VS
A Roslyn deployed in the hive always won over the installed VS's, so a stale or locally built one could not be bypassed. With the switch the hive is skipped and the version comes from the installed VS's Microsoft.CodeAnalysis.dll; an explicit -RoslynVersion still takes precedence. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent c7bf227 commit 1a955d1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎start-vs-VisualFSharpSln.ps1‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
#
1010
# -RoslynVersion forces a package version; any 5.Y.* binds identically within a minor.
1111
# -RoslynRepo is where a locally built Roslyn was packed (default: a sibling roslyn folder).
12+
# -InstalledRoslyn takes the version from the installed VS even when the hive has a Roslyn of its own.
1213
[CmdletBinding()]
1314
param(
1415
[string]$RoslynVersion,
1516
[string]$DevEnv,
1617
[string]$RootSuffix = 'RoslynDev',
1718
[string]$Solution = 'VisualFSharp.slnx',
1819
[string]$RoslynRepo,
20+
[switch]$InstalledRoslyn,
1921
[switch]$DryRun
2022
)
2123
Set-StrictMode -Version Latest; $ErrorActionPreference = 'Stop'; $root = $PSScriptRoot
@@ -69,7 +71,7 @@ if (-not $RoslynVersion) {
6971
$hiveRoslyn = Get-ChildItem (Join-Path $hive 'Extensions') -Recurse -Filter 'Microsoft.CodeAnalysis.dll' -ErrorAction SilentlyContinue |
7072
Where-Object { $_.DirectoryName -like '*Roslyn Language Services*' } | Select-Object -First 1
7173

72-
if ($hiveRoslyn) {
74+
if ($hiveRoslyn -and -not $InstalledRoslyn) {
7375
$target = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($hiveRoslyn.FullName).ProductVersion
7476
$source = "deployed in $RootSuffix"
7577
}

0 commit comments

Comments
 (0)