Category Archives: Utilities

MSDN Article: Using XML Comments

The May 2009 MSDN Magazine has a good article reviewing XML comments and their usefulness for code development and documentation.  The article is primarily written for VB developers, but the concepts do apply to C# developers as well.

I’ve been using XML comments since Visual Studio 2005 came out.  For your VB developers still developing legacy .NET 1.1 / VS 2003 apps, you can install the VBCommenter add-in, which will give you some of the basic functionality (C# developers have this out-of-the-box).

If you’re not familiar with XML comments – or if you’ve heard of them, but haven’t tried them out yet – give the article a look.

Changing of the Mock Tool

I’ve just recently started using NMock2 on a new class library that I am building, which makes use of several external resources (e.g. mail server, FTP, etc.). So, in writing my unit tests, it made sense to use some type of mock object so that I was not dependent on these external resources during testing.

However, because my assembly is strongly-named, I discovered that I can’t use the NMock2 library because a strongly-named assembly can only reference other strongly-named assemblies – and for some reason, NMock2 is not strongly-named. There have been a couple requests, but they all seem to have fallen on deaf ears – or nobody is at the wheel steering this project anymore.

So I am left looking for other options. I thought I’d give Rhino Mocks a try after hearing about it from Tim. It looks promising…

A Different Way to do Version Control

One of the best features I like about version control systems is the ability to do a line-by-line comparison between a local and checked-in file. Of course, there are times when I want to do that with other text files that I would otherwise not keep under source control.

Now it is possible, with a cool little utility application called WinMerge. In the absence of true Source Control, this free app can be a time-saver when moving source files between environments. For those of us who do personal web development, but aren’t hardcore enough to have a separate server with version control functionality, this is a great little tool.

Of course, I would never recommend this tool over an actual version control system.

See Your Own (.NET) Reflection

Two posts in one week?! Ney, two posts in one night! This must be some kind of record!

I thought I’d mention a nice little .NET tool from Lutz Roeder, called the .NET Reflector. This tool is one of my personal favorites because it allows you to take any .NET assembly and view the source code directly in your language of choice, all thanks to the CIL. (If you are using .NET and don’t yet know what CIL is, you may want to look it up).

Continue reading

Snippy for your C# Code Snippets

For those of you working with Visual Studio 2005, you’ve no doubt discovered the awesome power of Code Snippets, as well as the ability to design your own Code Snippet templates. Unfortunately, for those of us developing in C#, Microsoft kind of forgot about us when they decided to create a code snippet editor tool.

Code Snippet example

After a bit of Googling, I came across Snippy, a tool for generating Code Snippets for C# developers. So far, I’ve used it for some fairly simple templates, and it seems to work pretty well. The documentation was a little less-than-useful however, and I ended up loading Microsoft’s code snippet files as examples to see how to build my own template.

The UI is basically laid out as the XML tags would be generated, but it is definitely a time-saver over writing straight XML – once you do get past the 5 – 10 minute learning curve.

Regular Expressions… Buwhaa??

Here is an interesting CodeProject article dealing with .NET regular expressions that also includes information about a nice Regex utility application.

I learned the concept of regular expressions from my Computer Science courses in college, so I understand the value of them when validating some sort of input. But I’m sorry to say I’ve never taken the time to learn how to use regular expressions in .NET.