Skip to content

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Jul 14, 2022

Fixes #6792

Description

Fixes build of project using source generators coming from NuGet packages. I fixed this by only including analyzers that are coming from a FrameworkReference in the temporary target assembly project. Those analyzers are the ones that are not automatically added in the temporary target assembly project because ResolveTargetingPackAssets is never called (We could investigate calling this target in the future but, to me, it seemed riskier than the changes in this PR).

Customer Impact

Fixes build.

Regression

This is a regression introduced in .Net 6.0.7 by #6534 which was backported by #6680. Those were changes from me, sorry about the regression.

Testing

Tested locally by building a project which uses Regex source generator, WinForms source generator and CommunityToolkit.Mvvm 7.1.2 source generator (This is an example of a source generator that currently fails on .Net 6.0.7 SDK).

Risk

Low.

@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner July 14, 2022 02:40
@ghost ghost assigned ThomasGoulet73 Jul 14, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jul 14, 2022
@ghost ghost requested review from SamBent, dipeshmsft and singhashish-wpf July 14, 2022 02:40
@ghost ghost added the Community Contribution A label for all community Contributions label Jul 14, 2022
@ThomasGoulet73
Copy link
Contributor Author

@dotnet/wpf-developers: This should probably be considered to be backported to .Net 6.0.

@candritzky
Copy link

This is just to confirm that this patch will also fix the problems we're having with WPF class libraries in tandem with Refit.

AliveDevil added a commit to iterate-ch/cyberduck that referenced this pull request Jul 14, 2022
AliveDevil added a commit to iterate-ch/cyberduck that referenced this pull request Jul 14, 2022
@dipeshmsft dipeshmsft merged commit 42ca808 into dotnet:main Jul 14, 2022
@ThomasGoulet73 ThomasGoulet73 deleted the fix-source-generator-nuget-build branch July 18, 2022 17:53
@ghost ghost locked as resolved and limited conversation to collaborators Aug 17, 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.

Visual Studio 17.2.6 Breaks CommunityToolkit.Mvvm
3 participants