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 dd50f5a1a9..c023df8855 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/SKILL.md @@ -56,7 +56,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. -2. Run `dotnet --version` to confirm the .NET 10 SDK is installed. If it is not, stop and inform the user. +2. Run `dotnet --version` to confirm the .NET 10 SDK is installed, and verify that the IDE in use supports `net10.0` (Visual Studio 2026 / 18.0+; see `references/sdk-msbuild-dotnet9to10.md`). If the SDK is not installed, 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 - **PackageReferences**: `Microsoft.EntityFrameworkCore.*` → EF Core; `Microsoft.Data.Sqlite` → Sqlite; `Microsoft.Extensions.Hosting` → Generic Host / BackgroundService @@ -235,6 +235,8 @@ Behavioral changes do not cause build errors but may change runtime behavior. Re 5. **Solution file format**: If `dotnet new sln` is used in scripts, note it now generates SLNX format. Pass `--format sln` if the old format is needed. +6. **Visual Studio compatibility**: Ensure CI images and developer machines that build with Visual Studio use Visual Studio 2026 (18.0+) to target `net10.0`. + ### Step 6: Verify 1. Run a full clean build: `dotnet build --no-incremental` diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/csharp-compiler-dotnet9to10.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/csharp-compiler-dotnet9to10.md index caa692a5a5..ee8c8a9aec 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/csharp-compiler-dotnet9to10.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/csharp-compiler-dotnet9to10.md @@ -12,6 +12,8 @@ Two diagnostics apply: - **CS9258** (warning, VS 17.12+): `field` binds to the synthesized backing field instead of an existing member (e.g., a class field named `field`). Use `this.field` or `@field` to refer to the member. - **CS9272** (error, VS 17.14+): A local variable or nested-function parameter named `field` is **disallowed** inside a property accessor. Rename the variable or use `@field`. +These Visual Studio versions describe when the `field` diagnostics appear; they are not the overall Visual Studio requirement for targeting .NET 10. See the [IDE / Visual Studio compatibility guidance](sdk-msbuild-dotnet9to10.md). + ```csharp // BREAKS — CS9272 error public object Property diff --git a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/sdk-msbuild-dotnet9to10.md b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/sdk-msbuild-dotnet9to10.md index a962cc67ee..0daa99c097 100644 --- a/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/sdk-msbuild-dotnet9to10.md +++ b/plugins/dotnet-upgrade/skills/migrate-dotnet9-to-dotnet10/references/sdk-msbuild-dotnet9to10.md @@ -32,6 +32,14 @@ Every `` must now have a `Version` attribute or use Central Pa ``` **Mitigation:** Use `dotnet new sln --format sln` for the classic format. Ensure your tooling (Visual Studio, Rider, etc.) supports SLNX. +## IDE / Visual Studio compatibility + +To target `net10.0` with official Visual Studio support, use Visual Studio 2026 (18.0+) or a later release. Microsoft's [SDK, MSBuild, and Visual Studio compatibility table](https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs) lists .NET SDK 10.0.100 as loadable starting with Visual Studio 17.14, but that version of Visual Studio supports targeting only through `net9.0`; targeting `net10.0` is officially supported in Visual Studio 18.0+ only. Using a newer SDK to target a newer framework in an older Visual Studio version is unsupported and produces a build warning. See the [.NET 10 release notes](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/overview) and [Visual Studio 2026 release notes](https://learn.microsoft.com/en-us/visualstudio/releases/2026/release-notes). + +Upgrade Visual Studio to 2026 (18.0+) for supported IDE builds. To build from the command line instead, install the .NET 10 SDK, pin the installed version in `global.json`, and use `dotnet build`; this does not add .NET 10 support to an older Visual Studio IDE. + +The [SLNX compatibility guidance](https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/10.0/dotnet-new-sln-slnx-default) describes SLNX as well-supported by major .NET tooling but does not specify minimum IDE versions. If an IDE's SLNX support is uncertain, use `dotnet new sln --format sln` to create the classic `.sln` format. + ### Other behavioral changes - `--interactive` defaults to `true` in user scenarios — use `--interactive false` in scripts