CaptainToTo
CaptainToTo
CC#
Created by CaptainToTo on 11/10/2024 in #help
✅ Include Source Generator With Library
I created a source generator for a framework I'm making. I'm trying to make the include tree look like this:
Generator -> Framework -> Application
^ ^
Generator applied to
both framework & application
Generator -> Framework -> Application
^ ^
Generator applied to
both framework & application
I'm including each like this:
application csproj:
<ProjectReference Include="../Framework/Framework.csproj" />
application csproj:
<ProjectReference Include="../Framework/Framework.csproj" />
framework csproj:
<ProjectReference Include="../Generator/Generator.csproj" OutputItemType="analyzer" ReferenceOutputAssembly="false" />
framework csproj:
<ProjectReference Include="../Generator/Generator.csproj" OutputItemType="analyzer" ReferenceOutputAssembly="false" />
generator csproj:
<None Include="$(OutputPath)/netver/$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
generator csproj:
<None Include="$(OutputPath)/netver/$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
rn the generator is only being applied to the framework. I've been looking all over to figure out how to get it to also apply to the application, but I can't find anything that works. Any suggestions would be super helpful.
3 replies