Tips and Tricks to Developing Managed Code

4/19/2010

Managed code solves several of the problems inherent with programming in native code, and it takes care of many of the "house-keeping" aspects associated with programming in native code. Yet, the way that you implement managed code can make a significant difference in the performance and robustness of your finished application.

Optimizing Performance

Please refer to the Windows Mobile Developer Wiki for information on optimizing the performance of your managed code.

Automatic Code Verification

Although FxCop is being phased out, and although many of the warnings and errors it reports are not strictly relevant to Windows Mobile, it is still a very useful tool for uncovering bad programming practices in your Managed Code. For more information on FxCop, please see the GotDotNet web site.

Run-Time Debugging

Visual Studio supports breakpoints, and many other advanced debugging features. However, it can be occasionally useful to have a simple text string sent to the IDE's Output window.

To display text as your application is running, add the following line to the top of your application:

Using System.Diagnostics;

Then include the following line in your application, when you need to see output.

Debug.WriteLine("Hello, World");

Ensure that the Output tab is active - select Output from the View menu if it is not.

See Also

Other Resources

Developing with Managed Code