From 34f25445a169cb523c83ae7b9d77c3d7ffa31224 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:28:45 +0000 Subject: [PATCH 1/6] Initial plan From ecb9aa9de9dfe0054e5d4b5c3c279e5904d6ba8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:34:20 +0000 Subject: [PATCH 2/6] Add F# support to migrate-dotnet* skills Update migrate-dotnet8-to-dotnet9, migrate-dotnet9-to-dotnet10, and migrate-dotnet10-to-dotnet11 skills to support F# projects alongside C#: - Add .fsproj alongside .csproj in all project file references - Make C# compiler reference entries conditional on project language - Add F# compiler reference entries for each migration skill - Update frontmatter descriptions to mention F# versions Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com> --- .../migrate-dotnet10-to-dotnet11/SKILL.md | 16 +++++++++------- .../migrate-dotnet8-to-dotnet9/SKILL.md | 16 +++++++++------- .../migrate-dotnet9-to-dotnet10/SKILL.md | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md index 4f72dc8ebd..3837585f3d 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md @@ -6,7 +6,7 @@ description: > NOT for writing new programs. USE FOR: upgrading TargetFramework from net10.0 to net11.0, fixing build errors after updating the .NET 11 SDK, resolving source-breaking and behavioral changes - in .NET 11 runtime, C# 15 compiler, and EF Core 11, adapting to updated minimum + in .NET 11 runtime, C# 15 / F# 11 compiler, and EF Core 11, adapting to updated minimum hardware requirements (x86-64-v2, Arm64 LSE), and updating CI/CD pipelines and Dockerfiles for .NET 11. DO NOT USE FOR: .NET Framework migrations, upgrading from .NET 9 or earlier, @@ -26,7 +26,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b - Resolving build errors or new warnings after updating the .NET 11 SDK - Adapting to behavioral changes in .NET 11 runtime, ASP.NET Core 11, or EF Core 11 - Updating CI/CD pipelines, Dockerfiles, or deployment scripts for .NET 11 -- Fixing C# 15 compiler breaking changes after SDK upgrade +- Fixing C# 15 / F# 11 compiler breaking changes after SDK upgrade ## When Not to Use @@ -39,7 +39,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b | Input | Required | Description | |-------|----------|-------------| -| Project or solution path | Yes | The `.csproj`, `.sln`, or `.slnx` entry point to migrate | +| Project or solution path | Yes | The `.csproj`, `.fsproj`, `.sln`, or `.slnx` entry point to migrate | | Build command | No | How to build (e.g., `dotnet build`, a repo build script). Auto-detect if not provided | | Test command | No | How to run tests (e.g., `dotnet test`). Auto-detect if not provided | | Project type hints | No | Whether the project uses ASP.NET Core, EF Core, Cosmos DB, etc. Auto-detect from PackageReferences and SDK attributes if not provided | @@ -52,7 +52,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b ### Step 1: Assess the project -1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj` files. +1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj`/`.fsproj` files. 2. Run `dotnet --version` to confirm the .NET 11 SDK is installed. If it is not, stop and inform the user. 3. Determine which technology areas the project uses by examining: - **SDK attribute**: `Microsoft.NET.Sdk.Web` → ASP.NET Core; `Microsoft.NET.Sdk.WindowsDesktop` with `` or `` → WPF/WinForms @@ -67,7 +67,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b ### Step 2: Update the Target Framework -1. In each `.csproj` (or `Directory.Build.props` if centralized), change: +1. In each `.csproj`/`.fsproj` (or `Directory.Build.props` if centralized), change: ```xml net10.0 ``` @@ -89,7 +89,8 @@ Load reference documents based on the project's technology areas: | Reference file | When to load | |----------------|-------------| -| `references/csharp-compiler-dotnet10to11.md` | Always (C# 15 compiler breaking changes) | +| `references/csharp-compiler-dotnet10to11.md` | Project uses C# (C# 15 compiler breaking changes) | +| `references/fsharp-compiler-dotnet10to11.md` | Project uses F# (F# 11 compiler breaking changes) | | `references/core-libraries-dotnet10to11.md` | Always (applies to all .NET 11 projects) | | `references/sdk-msbuild-dotnet10to11.md` | Always (SDK and build tooling changes) | | `references/efcore-dotnet10to11.md` | Project uses Entity Framework Core (especially Cosmos DB provider) | @@ -185,7 +186,8 @@ The `references/` folder contains detailed breaking change information organized | Reference file | When to load | |----------------|-------------| -| `references/csharp-compiler-dotnet10to11.md` | Always (C# 15 compiler breaking changes) | +| `references/csharp-compiler-dotnet10to11.md` | Project uses C# (C# 15 compiler breaking changes) | +| `references/fsharp-compiler-dotnet10to11.md` | Project uses F# (F# 11 compiler breaking changes) | | `references/core-libraries-dotnet10to11.md` | Always (applies to all .NET 11 projects) | | `references/sdk-msbuild-dotnet10to11.md` | Always (SDK and build tooling changes) | | `references/efcore-dotnet10to11.md` | Project uses Entity Framework Core (especially Cosmos DB provider) | diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md index aea4942ae4..3738bd958e 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md @@ -3,10 +3,10 @@ name: migrate-dotnet8-to-dotnet9 description: > Migrate a .NET 8 project to .NET 9 and resolve all breaking changes. USE FOR: upgrading TargetFramework from net8.0 to net9.0, fixing build errors - after updating the .NET 9 SDK, resolving behavioral changes in .NET 9 / C# 13 / + after updating the .NET 9 SDK, resolving behavioral changes in .NET 9 / C# 13 / F# 9 / ASP.NET Core 9 / EF Core 9, replacing BinaryFormatter (now always throws), resolving SYSLIB0054-SYSLIB0057, adapting to params span overload resolution, - fixing C# 13 compiler changes, updating HttpClientFactory for SocketsHttpHandler, + fixing C# 13 / F# 9 compiler changes, updating HttpClientFactory for SocketsHttpHandler, and resolving EF Core 9 migration/Cosmos DB changes. DO NOT USE FOR: .NET Framework migrations, upgrading from .NET 7 or earlier, greenfield .NET 9 projects, or cosmetic modernization unrelated to the upgrade. @@ -35,7 +35,7 @@ Migrate a .NET 8 project or solution to .NET 9, systematically resolving all bre | Input | Required | Description | |-------|----------|-------------| -| Project or solution path | Yes | The `.csproj`, `.sln`, or `.slnx` entry point to migrate | +| Project or solution path | Yes | The `.csproj`, `.fsproj`, `.sln`, or `.slnx` entry point to migrate | | Build command | No | How to build (e.g., `dotnet build`, a repo build script). Auto-detect if not provided | | Test command | No | How to run tests (e.g., `dotnet test`). Auto-detect if not provided | | Project type hints | No | Whether the project uses ASP.NET Core, EF Core, WinForms, WPF, containers, etc. Auto-detect from PackageReferences and SDK attributes if not provided | @@ -48,7 +48,7 @@ Migrate a .NET 8 project or solution to .NET 9, systematically resolving all bre ### Step 1: Assess the project -1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj` files. +1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj`/`.fsproj` files. 2. Run `dotnet --version` to confirm the .NET 9 SDK is installed. If it is not, stop and inform the user. 3. Determine which technology areas the project uses by examining: - **SDK attribute**: `Microsoft.NET.Sdk.Web` → ASP.NET Core; `Microsoft.NET.Sdk.WindowsDesktop` with `` or `` → WPF/WinForms @@ -63,7 +63,7 @@ Migrate a .NET 8 project or solution to .NET 9, systematically resolving all bre ### Step 2: Update the Target Framework -1. In each `.csproj` (or `Directory.Build.props` if centralized), change: +1. In each `.csproj`/`.fsproj` (or `Directory.Build.props` if centralized), change: ```xml net8.0 ``` @@ -87,7 +87,8 @@ Work through compilation errors and new warnings systematically. Load the approp | If the project uses… | Load reference | |-----------------------|----------------| -| Any .NET 9 project | `references/csharp-compiler-dotnet8to9.md` | +| C# project | `references/csharp-compiler-dotnet8to9.md` | +| F# project | `references/fsharp-compiler-dotnet8to9.md` | | Any .NET 9 project | `references/core-libraries-dotnet8to9.md` | | Any .NET 9 project | `references/sdk-msbuild-dotnet8to9.md` | | ASP.NET Core | `references/aspnet-core-dotnet8to9.md` | @@ -219,7 +220,8 @@ The `references/` folder contains detailed breaking change information organized | Reference file | When to load | |----------------|-------------| -| `references/csharp-compiler-dotnet8to9.md` | Always (C# 13 compiler breaking changes — InlineArray on records, iterator safe context, collection expression overloads) | +| `references/csharp-compiler-dotnet8to9.md` | Project uses C# (C# 13 compiler breaking changes — InlineArray on records, iterator safe context, collection expression overloads) | +| `references/fsharp-compiler-dotnet8to9.md` | Project uses F# (F# 9 compiler breaking changes) | | `references/core-libraries-dotnet8to9.md` | Always (applies to all .NET 9 projects) | | `references/sdk-msbuild-dotnet8to9.md` | Always (SDK and build tooling changes) | | `references/aspnet-core-dotnet8to9.md` | Project uses ASP.NET Core | diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md index 32d1b71c74..59f20fc862 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md @@ -4,16 +4,17 @@ description: > Migrate a .NET 9 project or solution to .NET 10 and resolve all breaking changes. USE FOR: upgrading TargetFramework from net9.0 to net10.0, fixing build errors after updating the .NET 10 SDK, resolving source and behavioral changes in - .NET 10 / C# 14 / ASP.NET Core 10 / EF Core 10, updating Dockerfiles for + .NET 10 / C# 14 / F# 10 / ASP.NET Core 10 / EF Core 10, updating Dockerfiles for Debian-to-Ubuntu base images, resolving obsoletion warnings (SYSLIB0058-SYSLIB0062), adapting to SDK/NuGet changes (NU1510, PrunePackageReference), migrating System.Linq.Async to built-in AsyncEnumerable, fixing OpenApi v2 API changes, cryptography renames, and - C# 14 compiler changes (field keyword, extension keyword, span overloads). + C# 14 / F# 10 compiler changes (field keyword, extension keyword, span overloads). DO NOT USE FOR: .NET Framework migrations, upgrading from .NET 8 or earlier (use migrate-dotnet8-to-dotnet9 first), greenfield .NET 10 projects, or cosmetic modernization. - LOADS REFERENCES: csharp-compiler, core-libraries, sdk-msbuild (always); + LOADS REFERENCES: csharp-compiler (C# projects), fsharp-compiler (F# projects), + core-libraries, sdk-msbuild (always); aspnet-core, efcore, cryptography, extensions-hosting, serialization-networking, winforms-wpf, containers-interop (selective). --- @@ -41,7 +42,7 @@ Migrate a .NET 9 project or solution to .NET 10, systematically resolving all br | Input | Required | Description | |-------|----------|-------------| -| Project or solution path | Yes | The `.csproj`, `.sln`, or `.slnx` entry point to migrate | +| Project or solution path | Yes | The `.csproj`, `.fsproj`, `.sln`, or `.slnx` entry point to migrate | | Build command | No | How to build (e.g., `dotnet build`, a repo build script). Auto-detect if not provided | | Test command | No | How to run tests (e.g., `dotnet test`). Auto-detect if not provided | | Project type hints | No | Whether the project uses ASP.NET Core, EF Core, WinForms, WPF, containers, etc. Auto-detect from PackageReferences and SDK attributes if not provided | @@ -54,7 +55,7 @@ Migrate a .NET 9 project or solution to .NET 10, systematically resolving all br ### Step 1: Assess the project -1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj` files. +1. Identify how the project is built and tested. Look for build scripts, `.sln`/`.slnx` files, or individual `.csproj`/`.fsproj` files. 2. Run `dotnet --version` to confirm the .NET 10 SDK is installed. If it is not, stop and inform the user. 3. Determine which technology areas the project uses by examining: - **SDK attribute**: `Microsoft.NET.Sdk.Web` → ASP.NET Core; `Microsoft.NET.Sdk.WindowsDesktop` with `` or `` → WPF/WinForms @@ -68,7 +69,7 @@ Migrate a .NET 9 project or solution to .NET 10, systematically resolving all br ### Step 2: Update the Target Framework -1. In each `.csproj` (or `Directory.Build.props` if centralized), change: +1. In each `.csproj`/`.fsproj` (or `Directory.Build.props` if centralized), change: ```xml net9.0 ``` @@ -93,7 +94,8 @@ Work through compilation errors and new warnings systematically. Load the approp | If the project uses… | Load reference | |-----------------------|----------------| -| Any .NET 10 project | `references/csharp-compiler-dotnet9to10.md` | +| C# project | `references/csharp-compiler-dotnet9to10.md` | +| F# project | `references/fsharp-compiler-dotnet9to10.md` | | Any .NET 10 project | `references/core-libraries-dotnet9to10.md` | | Any .NET 10 project | `references/sdk-msbuild-dotnet9to10.md` | | ASP.NET Core | `references/aspnet-core-dotnet9to10.md` | @@ -261,7 +263,8 @@ The `references/` folder contains detailed breaking change information organized | Reference file | When to load | |----------------|-------------| -| `references/csharp-compiler-dotnet9to10.md` | Always (C# 14 compiler breaking changes — field keyword, extension keyword, span overloads) | +| `references/csharp-compiler-dotnet9to10.md` | Project uses C# (C# 14 compiler breaking changes — field keyword, extension keyword, span overloads) | +| `references/fsharp-compiler-dotnet9to10.md` | Project uses F# (F# 10 compiler breaking changes) | | `references/core-libraries-dotnet9to10.md` | Always (applies to all .NET 10 projects) | | `references/sdk-msbuild-dotnet9to10.md` | Always (SDK and build tooling changes) | | `references/aspnet-core-dotnet9to10.md` | Project uses ASP.NET Core | From 3a1a37ff18251243a682c3633eb9e14c82e27e6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:45:06 +0000 Subject: [PATCH 3/6] Add F# compiler breaking change reference files Create fsharp-compiler-dotnet8to9.md, fsharp-compiler-dotnet9to10.md, and fsharp-compiler-dotnet10to11.md with documented F# compiler breaking changes for each migration version, so the reference table entries added in the previous commit point to actual files. Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com> --- .../fsharp-compiler-dotnet10to11.md | 48 +++++++++++ .../references/fsharp-compiler-dotnet8to9.md | 55 ++++++++++++ .../references/fsharp-compiler-dotnet9to10.md | 85 +++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/references/fsharp-compiler-dotnet10to11.md create mode 100644 plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/references/fsharp-compiler-dotnet8to9.md create mode 100644 plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/fsharp-compiler-dotnet9to10.md diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/references/fsharp-compiler-dotnet10to11.md b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/references/fsharp-compiler-dotnet10to11.md new file mode 100644 index 0000000000..78a2248aa5 --- /dev/null +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/references/fsharp-compiler-dotnet10to11.md @@ -0,0 +1,48 @@ +# F# 11 Compiler Breaking Changes (.NET 11) + +These breaking changes affect F# projects targeting `net11.0` (which uses F# 11 by default). F# 11 ships with the .NET 11 SDK. + +> **Note:** .NET 11 is in preview. This covers changes through Preview 1. Additional breaking changes may be introduced in later previews. + +## Source-Incompatible Changes + +### ML compatibility removal + +**Impact: Medium.** F# 11 removes all remaining ML/OCaml compatibility constructs that the compiler has carried since F#'s origins as an OCaml dialect. This is a significant cleanup (~7,000 lines of legacy code removed). + +The following are **removed**: +- **Source file extensions:** `.ml` and `.mli` files are no longer recognized as F# source files. +- **Directives:** `#light` and `#indent` directives are removed. (Whitespace-sensitive syntax has been the default for many years.) +- **Compiler flags:** `--mlcompatibility`, `--light`, `--indentation-syntax`, `--no-indentation-syntax`, and `--ml-keywords` are all removed. +- **Reserved keywords released:** `asr`, `land`, `lor`, `lsl`, `lsr`, and `lxor` — previously reserved for ML compatibility — are now available as regular identifiers. + +```fsharp +// BREAKS — .ml file extension +// Rename MyModule.ml → MyModule.fs +// Rename MyModule.mli → MyModule.fsi + +// BREAKS — #light directive +#light "off" // error: directive no longer recognized + +// FIX — simply remove the directive (whitespace-sensitive syntax is the default) +``` + +**Fix:** +1. Rename any `.ml` files to `.fs` and `.mli` files to `.fsi`. +2. Remove all `#light` and `#indent` directives from source files. +3. Remove `--mlcompatibility` and related flags from project files, build scripts, and CI configurations. +4. If you used `asr`, `land`, `lor`, `lsl`, `lsr`, or `lxor` as escaped identifiers (e.g., `` ``asr`` ``), you can now use them as plain identifiers. + +See also: [dotnet/fsharp#19143](https://github.com/dotnet/fsharp/pull/19143) + +## Performance Improvements (non-breaking) + +### Parallel compilation enabled by default + +Parallel compilation (preview in F# 10) is now enabled by default for all projects. This includes parallel reference resolution, graph-based type checking, parallel optimizations, and parallel IL code generation. + +If you encounter issues, opt out with the `--parallelcompilation-` compiler flag. + +### Faster compilation of computation expression-heavy code + +The compiler's stack-overflow prevention mechanism (`StackGuard`) has been replaced with `RuntimeHelpers.TryEnsureSufficientExecutionStack()`, significantly reducing thread creation for deeply nested computation expressions (e.g., `task { }`, `async { }`). diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/references/fsharp-compiler-dotnet8to9.md b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/references/fsharp-compiler-dotnet8to9.md new file mode 100644 index 0000000000..4a7e2bb185 --- /dev/null +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/references/fsharp-compiler-dotnet8to9.md @@ -0,0 +1,55 @@ +# F# 9 Compiler Breaking Changes (.NET 9) + +These breaking changes affect F# projects targeting `net9.0` (which uses F# 9 by default). F# 9 ships with the .NET 9 SDK. + +## Source-Incompatible Changes + +### Auto-generated `.Is*` properties on discriminated unions + +**Impact: Medium.** F# 9 auto-generates `.Is*` properties for each case of a discriminated union. If you already defined custom `Is*` properties or members with the same names, a conflict will occur. + +```fsharp +// BREAKS — custom property conflicts with auto-generated one +type Shape = + | Circle of radius: float + | Rectangle of width: float * height: float + member this.IsCircle = // now conflicts with auto-generated IsCircle + match this with Circle _ -> true | _ -> false +``` + +**Fix:** Remove the custom `Is*` members — the compiler-generated versions provide the same functionality. + +### Struct unions with overlapping fields and reflection + +**Impact: Low–Medium.** In FSharp.Core 9.0, struct unions with overlapping fields now generate detailed internal mappings to support correct reading via reflection. Code or libraries using `FSharpValue.GetUnionFields` or similar reflection APIs on struct unions may see different behavior or exceptions if they relied on the previous incomplete mapping. + +**Fix:** Update libraries that reflect over struct unions. The new mapping is more complete and correct. + +### `ArgumentOutOfRangeException` for collection index out-of-bounds + +**Impact: Low.** Accessing an out-of-bounds index in FSharp.Core collections (e.g., `Array`, `List`) now throws `System.ArgumentOutOfRangeException` instead of `System.ArgumentException` in some cases. If your exception-handling code specifically catches `ArgumentException` and not `ArgumentOutOfRangeException`, update it. + +```fsharp +// Before: threw ArgumentException in some cases +// After: throws ArgumentOutOfRangeException +try + let _ = [1; 2; 3].[10] + () +with +| :? System.ArgumentOutOfRangeException -> () // update catch patterns +``` + +## New Language Features (non-breaking but relevant) + +### Nullable reference type support (opt-in) + +F# 9 adds support for nullable reference types, but this is **off by default**. Enable with `enable` in the `.fsproj` file. Enabling this may surface new warnings about null usage in existing code. + +### `_.Property` shorthand for member access in lambdas + +F# 9 introduces `_.Property` shorthand syntax in pipelines: +```fsharp +customers |> List.map _.Name +``` + +This is purely additive and does not break existing code. diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/fsharp-compiler-dotnet9to10.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/fsharp-compiler-dotnet9to10.md new file mode 100644 index 0000000000..2c63251363 --- /dev/null +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/fsharp-compiler-dotnet9to10.md @@ -0,0 +1,85 @@ +# F# 10 Compiler Breaking Changes (.NET 10) + +These breaking changes affect F# projects targeting `net10.0` (which uses F# 10 by default). F# 10 ships with the .NET 10 SDK. + +## Source-Incompatible Changes + +### `#nowarn` / `#warnon` directive syntax tightened + +**Impact: Medium.** F# 10 introduces `#warnon` for scoped warning suppression and tightens the syntax rules for warning directives: + +- **Multiline and empty `#nowarn` directives are disallowed.** +- **Whitespace between `#` and `nowarn` is disallowed** (e.g., `# nowarn` must be `#nowarn`). +- **Triple-quoted, interpolated, or verbatim strings for warning numbers are disallowed.** +- **In scripts (`.fsx`):** `#nowarn` now applies only until the end of the file or a corresponding `#warnon`, rather than affecting the whole script. + +```fsharp +// BREAKS — multiline #nowarn +#nowarn + "20" + +// BREAKS — whitespace between # and nowarn +# nowarn "20" + +// BREAKS — triple-quoted string +#nowarn """20""" + +// FIX — standard single-line syntax +#nowarn "20" +``` + +**Fix:** Update all `#nowarn` directives to use the standard single-line format with plain string literals. + +### Module-in-type structural validation + +**Impact: Low–Medium.** The compiler now raises an error when a `module` declaration appears indented at the same structural level inside a type definition. This was previously accepted but led to confusing scoping behavior. + +```fsharp +// BREAKS — module inside type at same indentation level +type MyType() = + member _.X = 1 +module Helpers = // error: module cannot appear here + let helper () = () + +// FIX — move module to outer scope +type MyType() = + member _.X = 1 + +module Helpers = + let helper () = () +``` + +### Access modifiers on auto property getters/setters + +**Impact: Low.** F# 10 allows different access modifiers for auto property getters and setters (e.g., `member val X = 0 with public get, private set`). This can cause conflicts if a computation expression builder defines members that clash with the new syntax parsing. + +**Fix:** If compilation fails in CE builder code after upgrading, review property accessor definitions for naming conflicts. + +## New Language Features (non-breaking but relevant) + +### Scoped warning suppression (`#warnon`) + +F# 10 introduces `#warnon` to re-enable a previously suppressed warning within the same file: +```fsharp +#nowarn "20" +// ... code where warning 20 is suppressed ... +#warnon "20" +// ... warning 20 is active again ... +``` + +### Union case access modifiers + +Discriminated union cases can now have access modifiers: +```fsharp +type Result<'T> = + | Ok of 'T + | internal Error of string +``` + +### `ValueOption` optional parameters + +Optional parameters can now use `[] ValueOption<'T>` to reduce heap allocations. + +### Parallel compilation (preview) + +Parallel compilation is available as a preview feature with `LangVersion=Preview` and `Deterministic=false`. This becomes the default in .NET 11. From 6f20f810e924923b286995fbe70b144a952e96dd Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 20 Mar 2026 10:24:58 +0100 Subject: [PATCH 4/6] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../skills/migrate-dotnet10-to-dotnet11/SKILL.md | 3 ++- .../skills/migrate-dotnet9-to-dotnet10/SKILL.md | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md index 3837585f3d..f00cb7321b 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md @@ -26,7 +26,8 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b - Resolving build errors or new warnings after updating the .NET 11 SDK - Adapting to behavioral changes in .NET 11 runtime, ASP.NET Core 11, or EF Core 11 - Updating CI/CD pipelines, Dockerfiles, or deployment scripts for .NET 11 -- Fixing C# 15 / F# 11 compiler breaking changes after SDK upgrade +- Fixing C# 15 compiler breaking changes after SDK upgrade (see the C#-specific “Common patterns” list in Step 3) +- Fixing F# 11 compiler breaking changes after SDK upgrade (see the F# 11 “What’s new” documentation at https://learn.microsoft.com/dotnet/fsharp/whats-new/fsharp-11) ## When Not to Use diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md index 59f20fc862..6da727e434 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md @@ -9,7 +9,7 @@ description: > (SYSLIB0058-SYSLIB0062), adapting to SDK/NuGet changes (NU1510, PrunePackageReference), migrating System.Linq.Async to built-in AsyncEnumerable, fixing OpenApi v2 API changes, cryptography renames, and - C# 14 / F# 10 compiler changes (field keyword, extension keyword, span overloads). + C# 14 compiler changes (field keyword, extension keyword, span overloads) and F# 10 compiler changes. DO NOT USE FOR: .NET Framework migrations, upgrading from .NET 8 or earlier (use migrate-dotnet8-to-dotnet9 first), greenfield .NET 10 projects, or cosmetic modernization. @@ -90,12 +90,12 @@ Migrate a .NET 9 project or solution to .NET 10, systematically resolving all br ### Step 3: Resolve build errors and source-incompatible changes -Work through compilation errors and new warnings systematically. Load the appropriate reference documents based on the project type: +Work through compilation errors and new warnings systematically. Load the appropriate reference documents based on what your solution contains: -| If the project uses… | Load reference | -|-----------------------|----------------| -| C# project | `references/csharp-compiler-dotnet9to10.md` | -| F# project | `references/fsharp-compiler-dotnet9to10.md` | +| If your solution contains… | Load reference | +|----------------------------|----------------| +| C# projects | `references/csharp-compiler-dotnet9to10.md` | +| F# projects | `references/fsharp-compiler-dotnet9to10.md` | | Any .NET 10 project | `references/core-libraries-dotnet9to10.md` | | Any .NET 10 project | `references/sdk-msbuild-dotnet9to10.md` | | ASP.NET Core | `references/aspnet-core-dotnet9to10.md` | From 4138ea3fff6ff067a71d80f5ed45b35bbbbd580d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 09:30:33 +0000 Subject: [PATCH 5/6] Fix CI: add github.com/dotnet/fsharp to known-domains.txt and shorten migrate-dotnet9-to-dotnet10 description to under 1024 chars Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com> --- eng/reference-scanner/known-domains.txt | 1 + .../skills/migrate-dotnet9-to-dotnet10/SKILL.md | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/reference-scanner/known-domains.txt b/eng/reference-scanner/known-domains.txt index 41646d350e..01fc77cb38 100644 --- a/eng/reference-scanner/known-domains.txt +++ b/eng/reference-scanner/known-domains.txt @@ -36,6 +36,7 @@ github.com/dotnet/dotnet github.com/dotnet/dotnet-api-docs github.com/dotnet/dotnet-docker github.com/dotnet/efcore +github.com/dotnet/fsharp github.com/dotnet/maui github.com/dotnet/msbuild github.com/dotnet/roslyn diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md index 6da727e434..9736e850d2 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md @@ -4,16 +4,15 @@ description: > Migrate a .NET 9 project or solution to .NET 10 and resolve all breaking changes. USE FOR: upgrading TargetFramework from net9.0 to net10.0, fixing build errors after updating the .NET 10 SDK, resolving source and behavioral changes in - .NET 10 / C# 14 / F# 10 / ASP.NET Core 10 / EF Core 10, updating Dockerfiles for - Debian-to-Ubuntu base images, resolving obsoletion warnings - (SYSLIB0058-SYSLIB0062), adapting to SDK/NuGet changes (NU1510, - PrunePackageReference), migrating System.Linq.Async to built-in - AsyncEnumerable, fixing OpenApi v2 API changes, cryptography renames, and - C# 14 compiler changes (field keyword, extension keyword, span overloads) and F# 10 compiler changes. + .NET 10 / C# 14 / F# 10 / ASP.NET Core 10 / EF Core 10, updating Dockerfiles, + resolving obsoletion warnings (SYSLIB0058-SYSLIB0062), SDK/NuGet changes + (NU1510, PrunePackageReference), System.Linq.Async to built-in + AsyncEnumerable, OpenApi v2 API changes, cryptography renames, + C# 14 compiler changes (field keyword, extension keyword, span overloads), + and F# 10 compiler changes. DO NOT USE FOR: .NET Framework migrations, upgrading from .NET 8 or earlier - (use migrate-dotnet8-to-dotnet9 first), greenfield .NET 10 projects, or - cosmetic modernization. - LOADS REFERENCES: csharp-compiler (C# projects), fsharp-compiler (F# projects), + (use migrate-dotnet8-to-dotnet9 first), or greenfield .NET 10 projects. + LOADS REFERENCES: csharp-compiler (C#), fsharp-compiler (F#), core-libraries, sdk-msbuild (always); aspnet-core, efcore, cryptography, extensions-hosting, serialization-networking, winforms-wpf, containers-interop (selective). From e95247e4146b65550e234d276b304909953cf3e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 03:35:30 +0000 Subject: [PATCH 6/6] Address review: simplify compiler bullet, remove duplicate Step 3 reference tables Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/skills/sessions/0a773675-198f-4b82-98c4-75d53d1c76a0 --- .../skills/migrate-dotnet10-to-dotnet11/SKILL.md | 15 ++------------- .../skills/migrate-dotnet8-to-dotnet9/SKILL.md | 16 +--------------- .../skills/migrate-dotnet9-to-dotnet10/SKILL.md | 16 +--------------- 3 files changed, 4 insertions(+), 43 deletions(-) diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md index f00cb7321b..f525ce3f8a 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md @@ -26,8 +26,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b - Resolving build errors or new warnings after updating the .NET 11 SDK - Adapting to behavioral changes in .NET 11 runtime, ASP.NET Core 11, or EF Core 11 - Updating CI/CD pipelines, Dockerfiles, or deployment scripts for .NET 11 -- Fixing C# 15 compiler breaking changes after SDK upgrade (see the C#-specific “Common patterns” list in Step 3) -- Fixing F# 11 compiler breaking changes after SDK upgrade (see the F# 11 “What’s new” documentation at https://learn.microsoft.com/dotnet/fsharp/whats-new/fsharp-11) +- Fixing C# 15 and F# 11 compiler breaking changes after SDK upgrade ## When Not to Use @@ -86,17 +85,7 @@ Migrate a .NET 10 project or solution to .NET 11, systematically resolving all b ### Step 3: Fix source-breaking and compilation changes -Load reference documents based on the project's technology areas: - -| Reference file | When to load | -|----------------|-------------| -| `references/csharp-compiler-dotnet10to11.md` | Project uses C# (C# 15 compiler breaking changes) | -| `references/fsharp-compiler-dotnet10to11.md` | Project uses F# (F# 11 compiler breaking changes) | -| `references/core-libraries-dotnet10to11.md` | Always (applies to all .NET 11 projects) | -| `references/sdk-msbuild-dotnet10to11.md` | Always (SDK and build tooling changes) | -| `references/efcore-dotnet10to11.md` | Project uses Entity Framework Core (especially Cosmos DB provider) | -| `references/cryptography-dotnet10to11.md` | Project uses cryptography APIs or targets macOS | -| `references/runtime-jit-dotnet10to11.md` | Deploying to older hardware or embedded devices | +Load the appropriate reference documents from the Reference Documents table at the end of this skill based on the project's technology areas. Work through each build error systematically. Common patterns: diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md index 3738bd958e..2b39a4abbf 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet8-to-dotnet9/SKILL.md @@ -83,21 +83,7 @@ Migrate a .NET 8 project or solution to .NET 9, systematically resolving all bre ### Step 3: Resolve build errors and source-incompatible changes -Work through compilation errors and new warnings systematically. Load the appropriate reference documents based on the project type: - -| If the project uses… | Load reference | -|-----------------------|----------------| -| C# project | `references/csharp-compiler-dotnet8to9.md` | -| F# project | `references/fsharp-compiler-dotnet8to9.md` | -| Any .NET 9 project | `references/core-libraries-dotnet8to9.md` | -| Any .NET 9 project | `references/sdk-msbuild-dotnet8to9.md` | -| ASP.NET Core | `references/aspnet-core-dotnet8to9.md` | -| Entity Framework Core | `references/efcore-dotnet8to9.md` | -| Cryptography APIs | `references/cryptography-dotnet8to9.md` | -| System.Text.Json, HttpClient, networking | `references/serialization-networking-dotnet8to9.md` | -| Windows Forms or WPF | `references/winforms-wpf-dotnet8to9.md` | -| Docker containers, native interop | `references/containers-interop-dotnet8to9.md` | -| Runtime configuration, deployment | `references/deployment-runtime-dotnet8to9.md` | +Work through compilation errors and new warnings systematically. Load the appropriate reference documents from the Reference Documents table at the end of this skill based on the project type. **Common source-incompatible changes to check for:** diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md index 9736e850d2..893f71e4bd 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md @@ -89,21 +89,7 @@ Migrate a .NET 9 project or solution to .NET 10, systematically resolving all br ### Step 3: Resolve build errors and source-incompatible changes -Work through compilation errors and new warnings systematically. Load the appropriate reference documents based on what your solution contains: - -| If your solution contains… | Load reference | -|----------------------------|----------------| -| C# projects | `references/csharp-compiler-dotnet9to10.md` | -| F# projects | `references/fsharp-compiler-dotnet9to10.md` | -| Any .NET 10 project | `references/core-libraries-dotnet9to10.md` | -| Any .NET 10 project | `references/sdk-msbuild-dotnet9to10.md` | -| ASP.NET Core | `references/aspnet-core-dotnet9to10.md` | -| Entity Framework Core | `references/efcore-dotnet9to10.md` | -| Cryptography APIs | `references/cryptography-dotnet9to10.md` | -| Microsoft.Extensions.Hosting, BackgroundService, configuration | `references/extensions-hosting-dotnet9to10.md` | -| System.Text.Json, XmlSerializer, HttpClient, MailAddress, Uri | `references/serialization-networking-dotnet9to10.md` | -| Windows Forms or WPF | `references/winforms-wpf-dotnet9to10.md` | -| Docker containers, single-file apps, native interop | `references/containers-interop-dotnet9to10.md` | +Work through compilation errors and new warnings systematically. Load the appropriate reference documents from the Reference Documents table at the end of this skill based on what your solution contains. **Common source-incompatible changes to check for:**