0

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?

Kazbek
  • 182
  • 11
  • 1
    Maybe the sharp sign (i.e **#**) is a special symbol used when designing templates (like the dollar sign **$** too). Try to put the whole directives in block comments, and test the creation again. If the commented lines appear in a new project, then my theory is correct and there must be a way to escape the symbol **#**. – Rivo R. Nov 25 '22 at 15:09

1 Answers1

0

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.

enter image description here

Demo:

enter image description here

Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21