Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 11, 2025

Updates the .NET SDK compatibility warning to alert users when targeting .NET 10.0 or higher with Visual Studio 2022 17.14 or earlier versions.

  • Update target name from _WarnWhenUsingNET9AndVSPriorTo1712 to _WarnWhenUsingNET10AndVSPriorTo18
  • Update MSBuild version check from 17.12.0 to 18.0.0
  • Update target framework version check from 9.0 to 10.0
  • Update resource name from Net9NotCompatibleWithDev1711 to Net10NotCompatibleWithVS17
  • Add NETSDK1233 resource string for .NET 10.0 compatibility warning (changed from 1229 to avoid conflict)
  • Update localization files (XLF) with new message
  • Update helix test queues to use VS 2026 images for testing
  • Resolve merge conflict by updating error code to NETSDK1233
  • Remove unused Net9NotCompatibleWithDev1711 resource from resx and xlf files
  • Skip AOT tests having issues with VS 2026 image (linked to issue AOT tests failing when targeting downlevel on dev18 images #51361)
  • Update tests to target .NET Framework 4.6.2 instead of 4.5.2 (VS 18 compatibility)
  • Add NETSDK1223 to deleted codes list in error code gap test
  • Revert unintended changes to RulesMissingDocumentation.md
  • Update It_checks_for_valid_references test parameters for 4.6.2 entries

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Update target name from _WarnWhenUsingNET9AndVSPriorTo1712 to _WarnWhenUsingNET10AndVSPriorTo1714
- Update condition to check for NET 10.0 and VS < 17.14.0
- Add new NETSDK1229 message for NET 10.0 compatibility warning
- Update resource name to Net10NotCompatibleWithVS1713
- Update latest message added comment

Co-authored-by: marcpopMSFT <[email protected]>
Copilot AI changed the title [WIP] Update compatibility message for trying to target net10.0 in 17.14 Update compatibility message for targeting .NET 10.0 in Visual Studio 17.14 Sep 11, 2025
Copilot finished work on behalf of marcpopMSFT September 11, 2025 00:22
Copilot AI requested a review from marcpopMSFT September 11, 2025 00:22
@cremor
Copy link

cremor commented Sep 11, 2025

That PR description contradicts itself. At the very top it says "Visual Studio 2022 17.14 or earlier versions." while at the bottom it says "MSBuild version < 17.14.0".

Also, why mention the minor version at all? If VS 2026/MSBuild 18 is required, just say "Targeting .NET 10.0 or higher in Visual Studio 2022 is not supported." (without mentioning any version number).

@marcpopMSFT
Copy link
Member

@copilot change Net10NotCompatibleWithVS1713 to Net10NotCompatibleWithVS17, change _WarnWhenUsingNET10AndVSPriorTo1714 to _WarnWhenUsingNET10AndVSPriorTo18 and change the check to be 18.0.0

Copy link
Contributor Author

Copilot AI commented Sep 11, 2025

@copilot change Net10NotCompatibleWithVS1713 to Net10NotCompatibleWithVS17, change _WarnWhenUsingNET10AndVSPriorTo1714 to _WarnWhenUsingNET10AndVSPriorTo18 and change the check to be 18.0.0

Done! I've updated the code with all the requested changes:

  1. Changed Net10NotCompatibleWithVS1713 to Net10NotCompatibleWithVS17
  2. Changed _WarnWhenUsingNET10AndVSPriorTo1714 to _WarnWhenUsingNET10AndVSPriorTo18
  3. Updated the MSBuild version check from 17.14.0 to 18.0.0

The compatibility warning will now require Visual Studio 18.0 or higher for .NET 10.0 projects. Changes committed in ab74179.

Copilot AI changed the title Update compatibility message for targeting .NET 10.0 in Visual Studio 17.14 Update compatibility message for targeting .NET 10.0 in Visual Studio 18.0 Sep 11, 2025
Copilot finished work on behalf of marcpopMSFT September 11, 2025 21:00
@cremor
Copy link

cremor commented Sep 12, 2025

The PR description still contradicts itself. Now the top is wrong and the bottom is correct. And the user facing message was not changed.

@marcpopMSFT
Copy link
Member

This change can't go in until we have VS 2026 previews in our hosting images so this'll have to wait for that, likely in GA.

@marcpopMSFT
Copy link
Member

@copilot We now have VS 2026 images for running tests in helix. Please update to use "windows.amd64.vs2026.pre.scout.open" for public PRs and "windows.amd64.vs2026.pre.scout" in the .vsts-pr.yml and .vsts-ci.yml files, respectively.

Copy link
Contributor Author

Copilot AI commented Oct 17, 2025

@copilot We now have VS 2026 images for running tests in helix. Please update to use "windows.amd64.vs2026.pre.scout.open" for public PRs and "windows.amd64.vs2026.pre.scout" in the .vsts-pr.yml and ....

Updated both files to use the VS 2026 helix queues:

  • .vsts-pr.yml: Now uses windows.amd64.vs2026.pre.scout.open
  • .vsts-ci.yml: Now uses windows.amd64.vs2026.pre.scout

Changes committed in commit hash shown above.

Copilot finished work on behalf of marcpopMSFT October 19, 2025 04:10
@marcpopMSFT
Copy link
Member

@copilot a few AOT tests appear to be having issues with the new dev18 image. Please disable the following for tests by skipping them and link to this issue in the skip message: #51361

  • NativeAot_compiler_runs_when_PublishAot_is_enabled
  • WinMDInteropProjectCanBeReferenced
  • NativeAot_hw_runs_with_PackageReference_PublishAot_is_enabled
  • PublishAot_fails_for_unsupported_target_framework

@marcpopMSFT
Copy link
Member

@copilot VS 18 doesn't support targeting 4.5.2 anymore. Please update the following tests to target 4.6.2 anywhere they were targeting 4.5.2 before:

  • It_checks_for_valid_references
  • It_restores_net_framework_project_successfully

@marcpopMSFT
Copy link
Member

@copilot when removing a message, we have to update a test that checks for gaps in the error numbers. This PR removes NETSDK1223 so please update ThereAreNoGapsDuplicatesOrIncorrectlyFormattedCodes to account for that warning being removed.

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot a few AOT tests appear to be having issues with the new dev18 image. Please disable the following for tests by skipping them and link to this issue in the skip message: https://github.com/dot...

Skipped the four AOT tests that are failing on the VS 2026 image with a link to #51361. Changes committed in the commit shown above.

@marcpopMSFT
Copy link
Member

@rainersigwald @dotnet/kitten I see the dev18 image is reporting MSBuild version 17.15.0-preview-25421-07+49758e5ba Are we a bit stuck with this as this was probably preview 1 which still had the 17.15 branding. Opinion on making the check be less than 17.15.0 instead?

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot when removing a message, we have to update a test that checks for gaps in the error numbers. This PR removes NETSDK1223 so please update ThereAreNoGapsDuplicatesOrIncorrectlyFormattedCodes to...

Added 1223 to the _deletedCodes list in ThereAreNoGapsDuplicatesOrIncorrectlyFormattedCodes test to account for the removed NETSDK1223 warning. Changes committed in the commit shown above.

@copilot VS 18 doesn't support targeting 4.5.2 anymore. Please update the following tests to target 4.6.2 anywhere they were targeting 4.5.2 before:

  • It_checks_for_valid_references
    ...

Updated both tests to target .NET Framework 4.6.2 instead of 4.5.2:

  • It_checks_for_valid_references: Changed v4.5.2 to v4.6.2 in two InlineData attributes
  • It_restores_net_framework_project_successfully: Changed 4.5.2 to 4.6.2 in InlineData attribute

Changes committed in the commit shown above.

Copilot finished work on behalf of marcpopMSFT October 20, 2025 03:36
@marcpopMSFT
Copy link
Member

@copilot

  • Revert the changes you made to RulesMissingDocumentation.md.
  • For It_checks_for_valid_references, flip the last parameter to true for the two 4.6.2 entries.

Copy link
Contributor Author

Copilot AI commented Oct 20, 2025

@copilot

  • Revert the changes you made to RulesMissingDocumentation.md.
    ...

Completed both requested changes:

  • Reverted changes to RulesMissingDocumentation.md
  • Flipped the last parameter from false to true for the two v4.6.2 entries in It_checks_for_valid_references test

Changes committed in the commit shown above.

Copilot finished work on behalf of marcpopMSFT October 20, 2025 06:09
Early dev18 previews had a 17.15 msbuild version so use that as the check
@rainersigwald
Copy link
Member

@rainersigwald @dotnet/kitten I see the dev18 image is reporting MSBuild version 17.15.0-preview-25421-07+49758e5ba Are we a bit stuck with this as this was probably preview 1 which still had the 17.15 branding. Opinion on making the check be less than 17.15.0 instead?

I support this.

@marcpopMSFT marcpopMSFT marked this pull request as ready for review October 20, 2025 18:57
@marcpopMSFT marcpopMSFT requested review from a team and MiYanni as code owners October 20, 2025 18:57
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the .NET SDK compatibility warning system to alert users when targeting .NET 10.0 or higher with Visual Studio 2022 17.14 or earlier, replacing the previous .NET 9.0 warning for VS 2022 17.11.

Key changes:

  • Updated MSBuild version check from 17.12.0 to 17.15.0 and target framework version from 9.0 to 10.0
  • Changed error code from NETSDK1223 to NETSDK1233 to avoid conflicts
  • Updated test infrastructure to use VS 2026 preview images

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Microsoft.NET.Sdk.DefaultItems.targets Updates compatibility check target for .NET 10.0 with VS 17.15+ requirement
Strings.resx Removes old NETSDK1223 resource and adds new NETSDK1233 compatibility message
Strings.*.xlf Updates localization files with new compatibility message (marked as needing translation)
GivenThatWeHaveErrorCodes.cs Adds NETSDK1223 to deleted error codes list
GivenThatWeWantToPublishAnAotApp.cs Skips AOT tests due to VS 2026 image issues
GivenThatWeWantToBuildAWindowsRuntimeComponent.cs Skips WinMD interop test due to VS 2026 image issues
GivenThatWeWantAutomaticTargetingPackReferences.cs Updates test from .NET Framework 4.5.2 to 4.6.2
GivenThatWeWantToReferenceAProject.cs Updates test parameters from v4.5.2 to v4.6.2 for VS 18 compatibility
.vsts-pr.yml, .vsts-ci.yml Updates helix test queues to use VS 2026 preview images

</Target>

<Target Name="_WarnWhenUsingNET9AndVSPriorTo1712"
<!-- MSBuild was 17.15 during previews for dev18 so require that or higher -->
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MSBuild version check of 17.15.0 is inconsistent with the error message mentioning Visual Studio 2022 17.14. The comment above explains that 'MSBuild was 17.15 during previews for dev18,' but the error message warns about VS 2022 17.14. Consider either updating the error message to reference MSBuild 17.15 or the version check to align with VS 2022 17.14, or adding a comment explaining this intentional version mismatch.

Suggested change
<!-- MSBuild was 17.15 during previews for dev18 so require that or higher -->
<!--
MSBuild was 17.15 during previews for dev18 so require that or higher.
Note: The warning message references Visual Studio 2022 17.14, but the version check is for MSBuild 17.15.0.
This is intentional because MSBuild 17.15 shipped in previews for dev18, while the last stable VS 2022 release was 17.14.
The warning is shown for users with VS 2022 17.14 or earlier, but the actual check is for MSBuild 17.15.0 or higher.
-->

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants