-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the PacketGen wiki! Currently being used as a README archive dump.
This is the simplest way to install but requires manually copying after each build.
Build the source gen project. Dll is built to bin\Debug\netstandard2.0.
Copy the dll to somewhere in the main project.
Add the following to the .csproj. Replace the path with the correct path to the dll.
<Analyzer Include="Framework/Libraries/PacketGen.dll" />This is the fastest way to debug the source gen without needing to manually copy a file after builds.
- Right click 'Template' solution, click 'Add > Existing Project', navigate to this source gen project.
- Right click 'Template' project, click 'Add > Project Reference...' and select the source gen project.
The following should have appeared in Template.csproj
<ProjectReference Include="..\PacketGen\PacketGen.csproj" >Change it so it looks like the following.
<ProjectReference Include="..\PacketGen\PacketGen.csproj"
OutputItemType="Analyzer"/>Build the source gen project then build the main project.
WIP
If the Analyzers in VS2022 are not showing anything being generated but the source gen is still generating the correct scripts then this is a VS2022 bug and restarting VS2022 should fix this.
Use context.ReportDiagnostic(...) or generate code comments to debug the source gen.
And apparently test projects are a thing. I'm new to this.