Home > .Net Articles > How to use preprocessor directives to conditionally compile code
.Net Articles
DataLG
Downloads
Contact

SourceForge.net Logo

How to use preprocessor directives to conditionally compile code

Having a development environment often requires to comment / decomment certain lines of code to differentiate between Debug and Release configuration.
There is a simple way of automatizing this with both C# and VB. Here's how.
Using VB :

Using C# :