0

I write class libraries often, and usually add a Program.cs so I can switch the output type to "console application" for debugging.

Is there a simple way to set VS up, so that:

  • When I select debug configuration, it compiles to a console application
  • When I select release configuration it compiles to a class library (and, if possible, excludes Program.cs from the build)
4ndy
  • 550
  • 1
  • 9
  • 23
  • Hmm, you can take advantage of conditionals in the .csproj file but pretty unclear how much that would upset the IDE and debugger. Most programmers take advantage of the built-in unit test runner, recommended. – Hans Passant Oct 31 '17 at 06:58
  • @ToshiBoy, Maybe you could think about using conditions with custom code: https://stackoverflow.com/questions/3788605/if-debug-vs-conditionaldebug – Jack Zhai Nov 01 '17 at 01:03

0 Answers0