Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

This PR cherry-picks the changes from PR #50749 to the release/10.0.1xx branch, updating the .NET SDK compatibility warning to alert users when targeting .NET 10.0 or higher with Visual Studio 2022 17.14 or earlier versions.

Changes

Compatibility Warning

  • Target Name: Updated from _WarnWhenUsingNET9AndVSPriorTo1712 to _WarnWhenUsingNET10AndVSPriorTo18
  • MSBuild Version Check: Changed from 17.12.0 to 17.15.0 (MSBuild was 17.15 during VS 18 previews)
  • Framework Version Check: Updated from .NET 9.0 to 10.0
  • Error Code: Changed from NETSDK1223 to NETSDK1233 (to avoid conflict with removed error)

Resource Strings

  • Removed Net9NotCompatibleWithDev1711 resource string (NETSDK1223)
  • Added Net10NotCompatibleWithVS17 resource string (NETSDK1233):

    "NETSDK1233: Targeting .NET 10.0 or higher in Visual Studio 2022 17.14 is not supported."

  • Updated all 13 localization (XLF) files with the new warning message

CI/CD Pipeline

  • Updated helix test queues to use VS 2026 preview images:
    • .vsts-ci.yml: windows.amd64.vs2022.prewindows.amd64.vs2026.pre.scout
    • .vsts-pr.yml: windows.amd64.vs2022.pre.openwindows.amd64.vs2026.pre.scout.open

Test Updates

  • Added NETSDK1223 to deleted error codes list in GivenThatWeHaveErrorCodes.cs
  • Updated test parameters from .NET Framework 4.5.2 to 4.6.2 for Visual Studio 18 compatibility
  • Skipped three AOT tests having issues with VS 2026 image (tracked in AOT tests failing when targeting downlevel on dev18 images #51361):
    • NativeAot_hw_runs_with_PackageReference_PublishAot_is_enabled
    • IsAotCompatible_implies_enable_analyzers (with net5.0/net6.0/net7.0)
    • NativeAot_compiler_runs_when_PublishAot_is_enabled

Testing

  • ✅ Build completed successfully
  • ✅ Error code validation tests passed
  • ✅ No security vulnerabilities detected

Related


This ensures developers targeting .NET 10.0 receive appropriate warnings about Visual Studio version compatibility, helping them understand the minimum VS version required for proper .NET 10.0 development experience.

Original prompt

Create a copy of this PR into the release/10.0.1xx branch fixing all merge conflicts: @dotnet/sdk/pull/50749


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix merge conflicts in release branch Cherry-pick PR #50749 to release/10.0.1xx: Update compatibility message for targeting .NET 10.0 in Visual Studio 18.0 Oct 20, 2025
Copilot AI requested a review from marcpopMSFT October 20, 2025 16:28
Copilot finished work on behalf of marcpopMSFT October 20, 2025 16:28
@marcpopMSFT marcpopMSFT marked this pull request as ready for review October 20, 2025 18:57
@marcpopMSFT marcpopMSFT requested a review from a team as a code owner October 20, 2025 18:57
@marcpopMSFT
Copy link
Member

I reviewed the changes closely and directed the copilot on actions. I haven't tested in a codespace as that's not supported but I can confirm we were getting the warnings when the check was 18.0.0 and aren't getting them now which aligns with a 17.15 msbuild in the preview image. I'll try building locally to test to confirm.

@marcpopMSFT
Copy link
Member

Tested locally. Confirmed I don't get a warning when using msbuild 18 or dotnet build for 10 but do get a warning using 17.14 msbuild + local sdk setting DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR.

@marcpopMSFT marcpopMSFT changed the title Cherry-pick PR #50749 to release/10.0.1xx: Update compatibility message for targeting .NET 10.0 in Visual Studio 18.0 Cherry-pick PR #50749 to release/10.0.1xx: Update compatibility message for targeting .NET 10.0 in Visual Studio 17.14 Oct 20, 2025
@marcpopMSFT marcpopMSFT added this to the 10.0.0 milestone Oct 20, 2025
@marcpopMSFT
Copy link
Member

Approved offline for GA

@marcpopMSFT marcpopMSFT merged commit fc38963 into release/10.0.1xx Oct 20, 2025
28 of 29 checks passed
@marcpopMSFT marcpopMSFT deleted the copilot/fix-merge-conflicts-release branch October 20, 2025 21:36
@balachir
Copy link

@marcpopMSFT to verify this fix, Nicole tried the following and she reported that no warning was shown.

  • Install VS 17.14 (latest released)
  • Install .NET 10 GA SDK
  • Create new or open existing 10.0 project using VS 17.14
  • Build the project
image

You mentioned in the comments above that an additional local sdk setting DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR is needed to verify this. Can you clarify why this setting is needed? And how will external customers see this warning if this additional setting is needed?

cc: @NicoleWang001

@marcpopMSFT
Copy link
Member

No env variables should be required for testing with the official builds. That was just for testing the locally built version.

  • Install VS 17.14
  • Install 10.0.100 with the fix
  • create a project targeting net10
  • Build

For that last step, you have to ensure that 17.14 is actually loading the 10 sdk. If it loads the 9 sdk, you'll get a different warning. Locally, I was struggling to get the 10 sdk to load when I launched VS through the OS. However, if I opened a 17.14 developer command prompt and used devenv, it worked. It also worked if I used msbuild to build the project from that developer command prompt.

The loading of the net10 sdk into 17.14 launched from the OS is a separate issue than this bug.

@NicoleWang001
Copy link
Member

NicoleWang001 commented Oct 23, 2025

Thanks @marcpopMSFT, we got the expected warning with the latest .NET 10 GA build 10.0.100-rtm.25522.103
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants