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. ...

Get Microsoft® .NET Compact Framework (Core Reference) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.