In-Depth

.NET Toolbox Picks: Part II

Seven alternative tools and widgets for .NET programmers.

The Microsoft Developer Network (MSDN) is a great resource for developers looking for utilities to supplement their programming experiences, but there are other very useful tools distributed directly by third parties. In our first installment of this two-part series we highlighted utilities hosted by Microsoft. Now we look further afield, highlighting seven utilities from third parties. (Technically, one is in fact a Microsoft tool, but it's not hosted on the main Microsoft site.)

Like the first group we profiled, we cover a diverse set of tools that are either free or carry a nominal licensing fee. NDoc 2.0 is a tool that generates compiled help for Web sites presented in MSDN-style. ReSharper 3.0 helps -- among other things -- refactor C# and VB.NET code. Pattern Expert is designed to teach programmers how to implement design patterns in code. Reflector lets developers examine the contents of .NET assemblies. Outlook Redemption provides an easy and full-featured alternative to using MAPI, CDO or WebDAV. RegexDesigner.NET helps programmers of all levels design and test regular expressions in .NET applications. And finally, Fiddler is a traffic monitoring and tracing tool developed by Microsoft.

Seven Tools and Widgets
[click image for larger view]
7 Tools and Widgets

NDoc 2.0 Alpha
Pricing Information: Free
Have you ever wondered what those <summary> tags at the top of your classes are used for? They're not there just to clutter up your comments. The right tool can actually generate MSDN-style documentation from those tags. Finding the right tool for this job can be tricky, however. You can use NDoc for .NET 1.x projects, but it doesn't support .NET 2.0. Microsoft provides another documentation tool called SandCastle, but it's much harder to use than NDoc and is just not yet ready for prime time.

So what's a developer with a documentation deliverable deadline to do? The answer is NDoc 2.0, although you won't find it on the NDoc site. It seems that Kevin Downs, the most recent maintainer of the code base, has moved on to other things. However, the code for NDoc 2.0 has been made publicly available. And although this software is still an alpha version, it fills the void in the documentation-generation landscape until SandCastle firms up.

Using NDoc 2.0 you can easily generate a compiled help file or a Web site that documents your assemblies and presents them MSDN-style. The tool provides many features to customize the output and create professional-looking documentation. You can configure the headers, footer, title, copyright information and more with NDoc 2.0.

Figure 1
[click image for larger view]
Figure 1. NDoc 2.0 documents assemblies and presents them MSDN-style.

ReSharper 3.0
Pricing Information: $199
This tool provides more than a dozen productivity enhancers in one utility. As its name suggests, the product began as a refactoring tool for C#. The latest version now supports VB.NET as well, and includes a total of 27 refactoring features for C# and 17 for VB.NET. However, there's far more to this tool than just refactoring.

ReSharper has several navigation features. For example, with the Stack Trace Explorer you can paste your stack trace into the explorer and the tool will render each stack frame as a link that you can click to jump straight to the corresponding code. The Find Usages feature is several times faster than Visual Studio's Find All References. This tool also compiles your code in the background and underlines compilation problems. In addition, each compilation problem is indicated in the margin like a bookmark icon; clicking the icon in the margin jumps directly to the issue.

ReSharper also supports quick fixes. Suppose your assignment statement is missing a cast. ReSharper will offer to fix the code -- either by inserting the cast or changing the variable type. You can use ReSharper to format code according to your style guidelines with a single keystroke. ReSharper provides more intelligent IntelliSense than Visual Studio by filtering the selections based on the expected type. These features are just the tip of the iceberg -- if you'd like to increase your coding productivity, you need to try this tool.

PatternExpert
Pricing Information: $79 (Shareware)
This utility has a single purpose: to teach programmers how to implement design patterns in code. While this may classify more as a tutorial aid than a development tool, the fundamentals that it aims to teach ultimately motivate developers to write significantly better code, making it arguably the best kind of development tool available.

Every .NET developer should know about the singleton, faade and chain-of-responsibility patterns. Yet many are unfamiliar with the most important 22 patterns, made famous by "Design Patterns: Elements of Reusable Object-Oriented Software" (Addison-Wesley Professional, 1995) and the "gang of four." With PatternExpert, you select a pattern from the left tree view to start a simple wizard -- like presentation on the right that explains the purpose of the pattern and how to implement it. The View_Source menu will generate code snippets for each pattern in either C#, J# or C++ (VB, unfortunately, is not supported).

The user interface is a bit rough around the edges, but again, the appeal here is in the clear and concise manner in which you can quickly learn to implement any design pattern. As more programmers learn this, it becomes easier to understand the functionality being implemented by another programmer's code merely by identifying the design pattern that is used. If you're behind on your knowledge of design patterns, you definitely owe it to yourself to check out PatternExpert.

Figure 2.
[click image for larger view]
Figure 2. PatternExpert teaches programmers how to implement design patterns in code.

Reflector
Pricing Information: Free
Reflector lets you examine the contents of any .NET assembly. With it, you can browse an assembly's types, meta data, Intermediate Language (IL) instructions, resources and XML documentation. This makes it an excellent tool for studying the inner workings of any compiled assembly, including third-party tools and the .NET base class libraries themselves. These capabilities can help when troubleshooting problems that may lie in components for which no source code is available. Reflector works with all versions of the .NET Framework, and the latest version of this tool supports LINQ query expressions and other concepts introduced in .NET 3.5.

To start, open any number of assemblies and navigate through their various types (classes, properties, methods, etc.) in the tree view on the left. Then, select any type to instantaneously decompile it into your supported language of choice (IL, C#, VB, Delphi, C++, Chrome) displayed on the right.

There's one caveat, however. Reflector will find it difficult or impossible to translate assemblies that have been obfuscated -- a process whereby the understandable names and values in a compiled assembly are scrambled to thwart decompilers like Reflector, while preserving the assembly's ability to be executed by the CLR.

Figure 3.
[click image for larger view]
Figure 3. Reflector lets developers browse assembly types, meta data, IL instructions, resources and XML documentation.

Outlook Redemption
Pricing Information: $199
If you're struggling with Outlook/Exchange programming using MAPI, CDO or WebDAV, you'll find salvation in the Outlook Redemption library. Among the priciest of tools in our (mostly free) set of utilities, it will more than pay for itself the first time you use it. The license permits unlimited use in any number of apps.

This library offers the best object model yet for programmatically accessing mailboxes and their folders, mail items, appointments, etc. Perhaps the most compelling feature is its ability to bypass the warning dialogs raised by the Security Patch introduced since Office 2000 SP2. This makes it ideal for unattended service applications that need to talk to an Exchange store. Plus, Internet headers and extended properties (many of which are difficult or impossible to extract using MAPI or CDO) are all fully exposed and available through the object model.

You can also display the address book, import/export messages, manipulate Outlook accounts and more with this powerful tool.


Fiddler
Pricing Information: Free
The one tool in this roundup that Microsoft has developed is Fiddler, which provides network-traffic monitoring and tracing capabilities that make it possible to inspect and analyze the precise communication between client and server. It will tell you what cookies are being sent, what content is getting cached and much more. You can multi-select all the individual requests that make up a given page and it will compute "total page weight" statistics (number of requests and bytes). By exposing HTTP headers, you can determine whether pages are missing important headers -- such as expiration values -- that control client or proxy caching. If you've ever used NetMon (Network Monitor) for these sorts of tasks, you'll find Fiddler much easier to use since it exposes only HTTP traffic and has a much friendlier format.

Fiddler is a debugging proxy, meaning that it situates itself in the pipeline so that all network traffic flows through it. It can therefore easily intercept and expose all HTTP requests and responses between client and server. The tool earns its name by giving you the ability to "fiddle" with the network conversation that's taking place. For example, you can build a handcrafted request, or drag/drop a previous session request, and then optionally tweak values before executing it. There's also support for breakpoints and single-step debugging, which pause and resume HTTP traffic while permitting edits during execution.

Figure A.
[click image for larger view]
Figure A. All network traffic flows through Fiddler,
a debugging proxy.

RegexDesigner.NET
Pricing Information: Free
This is a great tool whether you're a regular expressions newbie or guru. You'll definitely appreciate the ease with which this handy utility lets you design and test regular expressions for match, replace and split operations in your .NET applications without the overhead of writing the code to develop them.

The best feature is the code generator, which will automatically create source code (in either VB.NET or C#) that implements your regular expression for either match, replace or split operations. The generated code for match operations includes check for match, get match, get matches, numbered groups and named groups. You can also compile your regular expressions directly to an assembly, which you can then reference from your application or reuse across multiple applications.

Figure 4.
[click image for larger view]
Figure 4. RegexDesigner.NET lets developers of all levels design and test regular expressions without the overhead of writing the code to develop them.

Visit the Web Sites:
NDoc 2.0
ReSharper 3.0
Pattern Expert
Reflector
Outlook Redemption
RegexDesigner.NET


The user interface is simple and allows you to provide a regular expression, text to match and, optionally, a replacement string. You can save "projects," which essentially persists these settings to a file that you can later reopen. It's therefore easy to build a regular expression library based on RegexDesigner.NET projects. The utility does not, however, provide assistance with learning regular expression syntax. For that, you can visit the .NET Framework Regular Expressions page on MSDN.

About the Author

Leonard Lobel is a principal consultant and Brian Schmitt is VP of software developent at twentysix New York, a Microsoft Gold Certified Partner. Lobel is a software developer who specializes in .NET ; Schmitt has been writing software professionally since 1993.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube