Skip to content

Roslyn code generator referenced via a 3rd package doesn't do anything #75132

Answered by paule96
paule96 asked this question in Q&A
Discussion options

You must be logged in to vote

So I kinda find a solution / workaround for me. Maybe it helps someone else.

What I do right now is the following:

Pack your generator

Edit your Property group in your csproj of the generator like the following:

<TargetFramework>netstandard2.0</TargetFramework>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<NoWarn>NU5128</NoWarn>
<LangVersion>8.0</LangVersion>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<IsRoslynComponent>true</IsRoslynComponent>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <!-- Generates a package at build -->
<IncludeBuildOutput>false</IncludeBuildOutput> <!-- Do not include the generator as a lib dependency -->

The…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@paule96
Comment options

@333fred
Comment options

@paule96
Comment options

@333fred
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by paule96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants