I have a custom script that generates C# source files to be included as source files for the library being built. I am currently doing something like this in my .csproj:
<!-- This automatically handles code generation needed by this library -->
<Target Name="codegen" BeforeTargets="GenerateAdditionalSources">
<Message Text="Running code generators" Importance="high" />
<Exec command="echo This will be a script that generates .cs files" />
</Target>
This calls the script and generates the .cs files in a generated directory under my project folder, but those files aren't seen by msbuild until the next time dotnet build is run.
What target should I use to avoid needing to re-run dotnet build?