.NET Tips and Tricks

Blog archive

Creating a Useful Task List in Visual Studio

What developers like to do best is to write code (and design the applications that will let them right code). Administrative overhead just gets in the way of writing code—even something as simple as a To Do list. Yet developers are constantly getting part way through a problem and having to go and work on something else, or to address another part of the application before returning to finish what they were working on.

The Visual Studio Task List actually helps with this. Just type a comment that begins with ToDo (e.g. 'ToDo or //ToDo) and is followed by some text, and a line with your text appears in the Task List. To see the Task List, from the View menu, and select Task List. When the Task List window displays, switch the drop down list at its top to Comments. Once you see the list of notes that you (or someone else) has left on the Task List, double-clicking on an item in the list takes you to that section of your application.

In addition to ToDo, there are two other tokens: HACK (for…) and UNDONE (for…). However, if you (or your team) wants to mark additional types of material, you can create your own custom tokens. Select Options From the Tools menu, and in the Options dialog, expand the Environment node to find the Task List entry. Enter a name for your token in the Name text box and click the Add button to define your token (if your token will be used in a case-sensitive language, make life easy for the token's users by making the name either all uppercase or all lowercase).

Unfortunately, there's no easy way to share custom tokens among a team. You can export your settings (which include custom tokens) into a file so that other developers can import your custom tokens…but it's probably just as easy for each developer to set up any new tokens you invent in their copy of Visual Studio (besides, then the developer will know what tokens are available).

Visual Studio 2010 displays all your tokens when you open a project -- earlier versions wouldn't populate the Task List until you opened the file containing the token. However, in earlier versions of Visual Studio, if you do a Find and Replace replacing "ToDo" with "ToDo" and click the Replace All button, Visual Studio would find all of the files containing a ToDo token and open them for you, updating the Task List as it goes.

Posted by Peter Vogel on 01/30/2012 at 4:59 PM

comments powered by Disqus


Subscribe on YouTube

Upcoming Events