I have Visual Studio C# project template with #if DEBUG
#endif
directives like this:
#if DEBUG
...
#endif
But when I creating project from this template it doesn't contain this part. Can I somehow make it to be in projects that created from this template?
Please follow this tutorial to create a template.
My test environment: vs 2022 17.4.1 C# .Net 6.0
The template created by Export Template
can correctly create what you want when added.
Demo: