Skip to content

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented May 4, 2022

Fixes #6522
Fixes dotnet/roslyn#60257

Description

Fixes the build when using source generators.

Customer Impact

Without this PR, customers cannot build a WPF application with source generators.

Regression

No. To my knowledge, it never worked.

Testing

Tested by building a blank WPF application that uses the Regex source generator. This PR fixed the build.

Risk

Low.

/cc @RussKie (It looks like your hunch about the Analyzers property was right)

Microsoft Reviewers: Open in CodeFlow

@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner May 4, 2022 23:34
@ghost ghost assigned ThomasGoulet73 May 4, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label May 4, 2022
@ghost ghost requested review from SamBent, dipeshmsft and singhashish-wpf May 4, 2022 23:34
@ghost ghost added the Community Contribution A label for all community Contributions label May 4, 2022
@RussKie
Copy link
Contributor

RussKie commented May 5, 2022

Nice! Can you please share binlogs generated before and after the change?

It would be great to add a test to dotnet/sdk (I guess here https://github.com/dotnet/sdk/tree/main/src/Assets/TestProjects) that creates a simple WPF app with a source generator. The test will be failing until this change is merged and flown through.

@singhashish-wpf we'd want this fix serviced into 6.0.

@ThomasGoulet73
Copy link
Contributor Author

Nice! Can you please share binlogs generated before and after the change?

Sure. Here's the binlogs + the project I used: WpfAppSourceGenerator.zip

It would be great to add a test to dotnet/sdk (I guess here https://github.com/dotnet/sdk/tree/main/src/Assets/TestProjects) that creates a simple WPF app with a source generator. The test will be failing until this change is merged and flown through.

I'll take a look at adding a test project.

@singhashish-wpf singhashish-wpf merged commit 6021101 into dotnet:main Jun 14, 2022
singhashish-wpf pushed a commit that referenced this pull request Jun 14, 2022
@RussKie
Copy link
Contributor

RussKie commented Jun 14, 2022

Thank you!

@ThomasGoulet73 ThomasGoulet73 deleted the fix-source-generator-build branch June 14, 2022 12:55
pchaurasia14 added a commit that referenced this pull request Jun 16, 2022
Fix build when using source generators (#6534)
@ghost ghost locked as resolved and limited conversation to collaborators Jul 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When UseWPF set True in a WinForms. Proj fails to recognize ApplicationConfiguration bootstrap code Regex Generators fail to build with WPF

5 participants