Partager via


Visual Studio 2005 Tips #1 - Create Task List Comments

Creating Task List Comments in your projects can ensure you to complete the important and esential tasks. This feature can be used to indicate a variety of work to be done at the location marked

The Task List displays comments embedded in your project code that begin with the comment marker for your development language, followed by a default task token such as TODO, HACK, or UNDONE, or a custom comment token.

The number of comments that appear in the Task List changes, depending on the type of project you are working on.
With Visual Basic projects, the Task List displays all of the comments in the project.
With Visual C# and Visual J# projects, the Task List displays only the comments that are found in the files currently opened for edit.
With Visual C++ projects, the Task List displays only the comments that are found in the file currently active in the editor.

To add a comment to the Task List
1. Open a source code file for editing in the Code Editor.

2. Begin a comment on a line of code you want to mark with <marker><token>, where <marker> is the comment marker for your development language, and <token> is the name of a recognized Task List comment token, such as TODO, HACK, or UNDONE, or a custom comment token.

By default, the task window is not visible, so the first thing you must do is make the task list visible. As with most things in Visual Studio, you can achieve this with either a keyboard shortcutt (Ctrl+Alt+K) or by going to View | Other Windows | Task List.

As with other Task List entries, you can double-click any comment entry to display the file indicated in the Code Editor and jump to the line of code marked.

Example of TODO Comment:
// TODO: Add references to specific resources here

Comments

  • Anonymous
    December 31, 2006
    Pretty nice site, wants to see much more on it! :) ,Pretty nice site, wants to see much more on it! :)

  • Anonymous
    June 01, 2007
    how can i view all commmentse for all files in my current project for C#? itsnot fair that vb can do this but not c#