Remove legacy WinRT.SourceGenerator and rename WinRT.SourceGenerator2#2354
Merged
Sergio0694 merged 7 commits intostaging/3.0from Mar 23, 2026
Merged
Conversation
Remove several project entries from src/cswinrt.slnx: the Authoring source-generator variants (WinRT.SourceGenerator.Roslyn4080.csproj, WinRT.SourceGenerator.Roslyn4120.csproj, WinRT.SourceGenerator.shproj) and the Tests/SourceGeneratorTest.csproj. This cleans up the solution by removing deprecated/unused source-generator project references and the associated test project so the solution matches current build targets.
Delete the WinRT.SourceGenerator authoring project (sources, analyzers, codefixers, diagnostics, resources, props and projitems) along with Roslyn-specific csproj wrappers (Roslyn4080/Roslyn4120) and related analyzer release notes. Also remove the SourceGeneratorTest test project and its test helpers. Cleans up the repository by removing the legacy/source-generator implementation and its test coverage.
Rename the SourceGenerator assembly from WinRT.SourceGenerator2 to WinRT.SourceGenerator and update build references accordingly. The csproj AssemblyName was changed for back-compat, and build scripts and Azure Pipeline templates were updated (staging, signing, and NuGet pack properties) to reference WinRT.SourceGenerator(.dll/.pdb) so packaging, signing, and build tasks work with the new assembly name.
Mark CsWinMD project with Build Project="false" in the solution file, as it references the removed SourceGenerator type and is not currently supported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment out the <Exec> call that invokes the CsWinMD tool in nuget/Microsoft.Windows.CsWinMD.targets and add a TODO to re-enable it when support is restored. The MakeDir for the output path remains. This prevents automatic execution of the tool until the underlying issue is addressed.
manodasanW
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the legacy
WinRT.SourceGeneratorauthoring project, its associated test project, and renameWinRT.SourceGenerator2toWinRT.SourceGeneratorfor back-compat.Changes
WinRT.SourceGeneratorshared project (sources, analyzers, code fixers, diagnostics, resources, props, projitems), Roslyn-specific csproj wrappers (Roslyn4080/Roslyn4120), and analyzer release notes.SourceGeneratorTestand its test helpers (DiagnosticAnalyzerTests,RuntimeClassCastCodeFixerTests, etc.).src/cswinrt.slnx.WinRT.SourceGenerator2assembly name toWinRT.SourceGeneratorin its csproj.build.cmdto reference the newWinRT.SourceGeneratorassembly name.