I have a library that relies on a source generator to work correctly. In the MyLibrary.csproj
, I reference the generator like so.
<ItemGroup>
<ProjectReference
Include="..\MyLibrary.Generators\MyLibrary.Generators.csproj"
PrivateAssets="contentfiles;build"
ReferenceOutputAssembly="false"
OutputItemType="analyzer"/>
</ItemGroup>
I need this analyzer reference to be transitive, i.e. projects that reference MyLibrary
should get the MyLibrary.Generators
analyzer transitively.
A simple reference like so does not seem to reference the analyzer, only MyLibrary
<ProjectReference Include="..\MyLibrary\MyLibrary.csproj" />
I want to stress that I am not looking for MyLibrary.Generators
to be consumed as a regular assembly reference, but as a Roslyn Analyzer so my source generator can run as intended during compile time.