Skip to content

Remove Roslyn 3.x support#1007

Merged
meziantou merged 4 commits intomainfrom
copilot/remove-support-roslyn-3x
Feb 16, 2026
Merged

Remove Roslyn 3.x support#1007
meziantou merged 4 commits intomainfrom
copilot/remove-support-roslyn-3x

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

Eliminates Roslyn 3.8 support to reduce maintenance overhead from conditional compilation directives. Minimum supported version is now Roslyn 4.2 (VS 2022+).

Changes

CI/Build Configuration

  • Removed roslyn3.8 from build matrix and build steps in .github/workflows/ci.yml
  • Removed Roslyn 3.8 <When> block from Directory.Build.targets
  • Removed Roslyn 3.8 DLLs from NuGet package in Meziantou.Analyzer.Pack.csproj
  • Updated package version to 3.0.x to reflect breaking change

Code Cleanup

  • Removed all #if ROSLYN_3_8 conditional compilation directives from:
    • ReplaceEnumToStringWithNameofAnalyzer.cs
    • CompilationExtensions.cs (including GetTypesByMetadataName polyfill)
    • OperationExtensions.cs (Roslyn 3.8 branch of GetChildOperations)
    • ReplaceEnumToStringWithNameofFixer.cs
    • ProjectBuilder.Validation.cs
  • Deleted DocumentBasedFixAllProvider.cs (entire file was Roslyn 3.8-only)

New analyzer code no longer requires version guards for Roslyn 4.x+ APIs.

Breaking Change

This is a breaking change that drops support for Visual Studio 2019. The package version has been bumped to 3.0.x to reflect this change according to semantic versioning.

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove support for Roslyn 3.x</issue_title>
<issue_description># Why

  • Maintenance cost, many #if in the code to gate features
  • Not tested locally, making build/test errors only detected on the CI

Impact

  • Remove support for VS2019 (doc). Still supported: VS 2022, VS 2026
  • Remove support for deprecated .NET SDKs

Roslyn 4.x and 5.x will still be supported

How

  • The NuGet package will not ship the DLLs for Roslyn 3.8
  • The tests for Roslyn 3.8 will are removed from CI
  • New code will not need #if</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
@meziantou
Copy link
Owner

@copilot Can you change the major version in the CI to be 3.0.x instead of 2.0.x

Copilot AI changed the title [WIP] Remove support for Roslyn 3.x and deprecated SDKs Remove Roslyn 3.x support Feb 15, 2026
Copilot AI requested a review from meziantou February 15, 2026 16:36
Co-authored-by: meziantou <509220+meziantou@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 15, 2026

@copilot Can you change the major version in the CI to be 3.0.x instead of 2.0.x

Updated the major version to 3.0.x in cc54a68

This was referenced Mar 20, 2026
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.

Remove support for Roslyn 3.x

2 participants