O'Reilly logo

.NET Programming: A Practical Guide Using C# by Pradeep Tapadiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Diagnostics and Support

So far we have looked at developing and deploying .NET applications. Part of software development is also to specify what the code is expected to do (by means of documentation) and to debug and verify that the code is working the way you expect. The .NET SDK provides many useful tools and mechanisms for these purposes. Let's take a look at some of them.

Tracing

The simplest way to check the behavior of the code is to add some trace statements into the code. The .NET Framework provides a class Debug (namespace System.Diagnostics) that provides many useful static methods to instrument your code. For example, Debug.Write can be used to output a string, as shown in the following code excerpt:

 // Project Tracing public static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required