Skip to content

Update target framework visibility conditions and remove VS-specific error message#52235

Merged
marcpopMSFT merged 3 commits intorelease/10.0.1xxfrom
copilot/remove-condition-net9-supported-framework
Feb 6, 2026
Merged

Update target framework visibility conditions and remove VS-specific error message#52235
marcpopMSFT merged 3 commits intorelease/10.0.1xxfrom
copilot/remove-condition-net9-supported-framework

Conversation

Copy link
Contributor

Copilot AI commented Dec 17, 2025

Description:

Two items in this PR.
Currently customers in VS 17.14 will see net10 in the project system dropdown even though they can't actually target it without a warning.
After team discussion, we decided to simplify error handling by removing the VS-specific error message (NETSDK1209) that was too difficult to maintain.

Customer impact

Customers will no longer see net10.0 when using VS 17.14 so they can't accidentally retarget and then get warnings that it's not supported.
All customers will now receive a consistent error message when targeting unsupported framework versions, regardless of whether they're using Visual Studio or not.

Error Message
The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. Download the .NET SDK from https://aka.ms/dotnet/download

Regression

No

Risk

Low

Align target framework visibility with VS/MSBuild version support to prevent users from seeing unsupported frameworks in older VS versions, and simplify error handling by removing VS-version-specific logic.

Changes

  • net9.0: Removed MSBuild 17.12.0 version condition (now unconditionally visible)
  • net10.0: Added MSBuild 18.0.0+ version condition
  • MinimumVisualStudioVersionForUnsupportedTargetFrameworkVersion: Removed (no longer needed)
  • DisplayVSMessage logic: Removed from Microsoft.NET.TargetFrameworkInference.targets
  • UnsupportedVisualStudioVersion resource (NETSDK1209): Removed
  • Error code 1209: Added to deleted codes list in GivenThatWeHaveErrorCodes.cs
  • Added comment explaining conditional inclusion rationale and VS/MSBuild version relationship

💡 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.

Copilot AI changed the title [WIP] Remove condition on net9.0 supported target framework Update target framework visibility conditions for VS version compatibility Dec 17, 2025
Copilot AI requested a review from marcpopMSFT December 17, 2025 22:03
@marcpopMSFT marcpopMSFT marked this pull request as ready for review December 17, 2025 23:43
@marcpopMSFT
Copy link
Member

@baronfel I'm trying to decide what to do with UnsupportedVisualStudioVersion as if I fix this, it'll tell customers to install 19.0 which is wrong for targeting 11 but if I set it to anything else, I have to remember to update it later. I wonder if the other error message is sufficient and we should just delete this one as it's too much of a hassle to upkeep.

@baronfel
Copy link
Member

@marcpopMSFT maybe we should reconsider where this message lives - perhaps the project system, especially with that new targeting dialog that VS added in dev18, would be a better solution for the problem we're trying to solve here?

@phenning
Copy link
Member

@baronfel , @JakeRadMSFT lets start a mail thread and discuss this offline.

@marcpopMSFT
Copy link
Member

@copilot after discussion we decided that we no longer want to have a specific VS warning message.
Instead, we want the following.

  • Remove MinimumVisualStudioVersionForUnsupportedTargetFrameworkVersion from this file
  • Remove DisplayVSMessage from Microsoft.NET.TaretFrameworkInference.targets
  • Remove the UnsupportedVisualStudioVersion resource
  • Find and update the test that tracks warning codes in GivenThatWeHaveErrorCodes.cs to mark 1209 as an expected missing code.

Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot after discussion we decided that we no longer want to have a specific VS warning message.
Instead, we want the following.

  • Remove MinimumVisualStudioVersionForUnsupportedTargetFrameworkVe...

Done in commit 2c2779f. Removed:

  • MinimumVisualStudioVersionForUnsupportedTargetFrameworkVersion property
  • DisplayVSMessage logic from Microsoft.NET.TargetFrameworkInference.targets
  • UnsupportedVisualStudioVersion resource (NETSDK1209)
  • Added 1209 to deleted error codes list in GivenThatWeHaveErrorCodes.cs

All tests passing.

Copilot AI changed the title Update target framework visibility conditions for VS version compatibility Update target framework visibility conditions and remove VS-specific error message Jan 27, 2026
Copilot AI requested a review from marcpopMSFT January 27, 2026 00:10
Copilot AI and others added 3 commits January 30, 2026 15:16
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
@marcpopMSFT marcpopMSFT force-pushed the copilot/remove-condition-net9-supported-framework branch from 351d16c to 2e67664 Compare January 30, 2026 23:16
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