Skip to content

Build F# projects with the .NET SDK compiler by default in Visual Studio - #20485

Open
T-Gro wants to merge 6 commits into
mainfrom
fix/issue-20484
Open

Build F# projects with the .NET SDK compiler by default in Visual Studio#20485
T-Gro wants to merge 6 commits into
mainfrom
fix/issue-20484

Conversation

@T-Gro

@T-Gro T-Gro commented Sep 8, 2026

Copy link
Copy Markdown
Member

Fixes #20484

Visual Studio now builds F# projects with the F# compiler from the installed .NET SDK by default, matching dotnet build. A new Tools > Options > F# Tools > Compiler option, "Use the .NET SDK F# compiler for builds", turns this off to fall back to the .NET Framework compiler bundled with Visual Studio. The default is registry-driven (HKCU\...\FSharp\UseNetSdkCompiler); explicit project values still win, and command-line builds are unaffected.

Copilot and others added 3 commits September 8, 2026 09:41
…for builds' option

Adds an HKCU-backed (Software\Microsoft\VisualStudio\FSharp\UseNetSdkCompiler)
DialogPage 'FSharpCompilerPropertyPage', on by default (absent/1 = ON, 0 = OFF),
registered via ProvideOptionPage. Makes writeHKCU create-or-open the subkey so a
fresh VS hive works. Adds resources, page-name id 6015, release note, and
persistence unit tests. Implements issue #20484 (VS UI slice).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Microsoft.FSharp.Targets no longer hard-defaults FSharpPreferNetFrameworkTools to true for VS builds. It now reads HKCU\Software\Microsoft\VisualStudio\FSharp\UseNetSdkCompiler and defaults to false (SDK compiler) when unset; explicit project values still win, registry value 0 forces the .NET Framework compiler. CLI (dotnet build) builds are unaffected (shim absent).

Updates the stale comment block, the 'WhichFSharpCompiler - Default Settings.proj' baseline to the SDK selection, and adds RegistryCompilerSelection.Tests.ps1 (5-case matrix). RED-first confirmed: Cases 1 and 3 fail against the un-patched targets; all 5 pass after the change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…age satellite

The Tools>Options>F# Tools>Compiler option page is registered via
[<ProvideOptionPage ... "F# Tools", "Compiler", 6000s, 6015s>] on FSharpPackage
(FSharp.Editor). VS resolves those node-title resource IDs from that package's UI
satellite, which is FSharp.ProjectSystem.FSharp/VSPackage.resx - the same place the
sibling "F# Interactive" page's 6000/6001 live. The new 6015="Compiler" string had
been added to FSharp.VS.FSI/VSPackage.resx (the FSI assembly's own satellite), where
VS would never find it, leaving the Compiler node title blank/unlocalized. Adding it
to the FSI resx without matching xlf also left that resx/xlf pair out of sync.

Move 6015="Compiler" to FSharp.ProjectSystem.FSharp/VSPackage.resx (next to 6000/6001)
and add the corresponding trans-units to all 13 VSPackage.*.xlf files; drop the stray
entry from FSharp.VS.FSI/VSPackage.resx, restoring that pair's xlf sync.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`vsintegration/src` docs/release-notes/.VisualStudio/18.vNext.md

@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Sep 8, 2026
…ault

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from abonie September 9, 2026 08:24
Comment thread src/FSharp.Build/Microsoft.FSharp.Targets
@T-Gro T-Gro added the AI-reviewed PR reviewed by AI review council label Sep 9, 2026
Copilot and others added 2 commits September 9, 2026 13:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Visual Studio option to build F# projects with the .NET SDK compiler (on by default)

1 participant