Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Part of dotnet/roslyn#81184.


Plan for Adding Deprecation Warning for RoslynCompilerType=Framework

  • Add new warning message string (NETSDK1234) to Strings.resx
  • Create deprecation check for RoslynCompilerType
  • Add comprehensive tests for the warning
    • Test that warning appears when RoslynCompilerType=Framework is set
    • Test that warning can be suppressed with NoWarn=NETSDK1234
    • Test that warning does not appear for other RoslynCompilerType values
  • Build and test the changes
  • Address PR feedback

Changes Made

PR Feedback Addressed

  • ✅ Inlined the deprecation target directly into Microsoft.NET.Sdk.BeforeCommon.targets (removed separate file)
  • ✅ Changed URL from aka.ms link to direct GitHub issue: Deprecate RoslynCompilerType=Framework roslyn#81184
  • ✅ Updated test file to use file-scoped namespace
  • ✅ Added sealed keyword to test class
  • ✅ Converted to primary constructor
  • ✅ Removed localized message text assertion (only checking for NETSDK1234 code)
  • ✅ Added locked attributes to Strings.resx for RoslynCompilerType, Framework, and {0}
  • ✅ Removed WarningsAsErrors test (SDK warnings don't work with TreatWarningsAsErrors the same way)
  • ✅ Fixed test search pattern to use " NETSDK1234" (with leading space) to avoid matching /nowarn:NETSDK1234 in command line output on Windows

Implementation

  • Warning Message (Strings.resx): NETSDK1234 with proper locked attributes
  • Target (inlined in Microsoft.NET.Sdk.BeforeCommon.targets): Checks for deprecated value and emits warning
  • Tests (6 tests, all passing ✅): Comprehensive coverage of warning and suppression scenarios

All tests passing: 6/6 ✅


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

Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add deprecation warning for RoslynCompilerType=Framework Add deprecation warning NETSDK1234 for RoslynCompilerType=Framework Nov 13, 2025
Copilot finished work on behalf of jjonescz November 13, 2025 18:28
Copilot AI requested a review from jjonescz November 13, 2025 18:28
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot finished work on behalf of jjonescz November 14, 2025 10:50
Copilot AI requested a review from jjonescz November 14, 2025 10:50
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
@jjonescz jjonescz marked this pull request as ready for review November 14, 2025 14:29
@jjonescz jjonescz requested review from a team and JoeRobich November 14, 2025 14:29
BeforeTargets="PrepareForBuild"
Condition="'$(RoslynCompilerType)' == 'Framework'">
<NETSdkWarning ResourceName="RoslynCompilerTypeFrameworkIsDeprecated"
FormatArguments="https://github.com/dotnet/roslyn/issues/81184" />
Copy link
Member

Choose a reason for hiding this comment

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

Do we normally use github links? Or some kind of shortlink?

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.

3 participants