Summary

In this chapter, we briefly looked at the System.Diagnostics namespace, highlighting its main features. Those include ways to instrument code to ease debugging as well as the monitoring of production software. We also learned about the introduction of the code contracts API in .NET 4, which allows you to go beyond the expressiveness of simple debug asserts by expressing more invariants about your code.

Finally, we also examined a common operation for programs: the ability to interact with other processes on the system. This functionality, too, finds its home in the same System.Diagnostics namespace.

Get C# 4.0 Unleashed 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.