Build F# projects with the .NET SDK compiler by default in Visual Studio - #20485
Open
T-Gro wants to merge 6 commits into
Open
Build F# projects with the .NET SDK compiler by default in Visual Studio#20485T-Gro wants to merge 6 commits into
T-Gro wants to merge 6 commits into
Conversation
…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>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
…ault Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
T-Gro
commented
Sep 9, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.