Microsoft® .NET Compact Framework (Core Reference)
by Andy Wigley, Stephen Wheelwright, Robert Burbidge, Rory MacLoed, Mark Sutton
Controlling Release Code Size
It is quite common for a developer to write code that is of interest only during development and is of no concern to the end user. When working in a resource-constrained environment such as Windows CE, you might want the power of such diagnostic code when developing the application, without having to include the extra code in the final product. There are two useful techniques that you can use if your application has code that is required only for the debug build. When Visual Studio .NET builds a debug version, it sets the DEBUG compile-time constant. This constant is not set for the release build.
You can use the #if preprocessor directive to conditionally compile code based on the value of a compile-time expression. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access