Sayfalar

5 Şubat 2011 Cumartesi

Error List and Task List


The Error List and Task List are two versions of the same window. The Error List catalogs error
information that’s generated by Visual Studio when it detects problematic code. The Task List shows a
similar view with to-do tasks and other code annotations you’re tracking. Each entry in the Error List and
Task List consists of a text description and, optionally, a link that leads you to a specific line of code
somewhere in your project.


With the default Visual Studio settings, the Error List appears automatically whenever you build a
project that has errors


To see the Task List, choose View ➤ Task List. Two types of tasks exist—user tasks and comments.
You can choose which you want to see from the drop-down list at the top of the Task List. User tasks are
entries you’ve specifically added to the Task List. You create these by clicking the Create User Task icon
(which looks like a clipboard with a check mark) in the Task List. You can give your task a basic
description, a priority, and a check mark to indicate when it’s complete.

■ Note As with breakpoints, any custom tasks you add by hand are stored in the hidden solution files. This makes
them fairly fragile—if you rename or move your project, these tasks will disappear without warning (or without
even a notification the next time you open the website).


The comment entries are more interesting because they’re added automatically and they link to a
specific line in your code. To try the comment feature, move somewhere in your code, and enter the
comment marker (//) followed by the word TODO (which is commonly referred to as a token tag). Now
type in some descriptive text:
// TODO: Replace this hard-coded value with a configuration file setting.
string fileName = @"c:\myfile.txt"
Because your comment uses the recognized token tag TODO, Visual Studio recognizes it and
automatically adds it to the Task List


To move to the line of code, double-click the new task entry. Notice that if you remove the
comment, the task entry is automatically removed as well.
Three token tags are built-in: HACK, TODO, and UNDONE. However, you can add more. Simply
select Tools ➤ Options. In the Options dialog box, navigate to the Environment ➤ Task List tab. You’ll
see a list of comment tokens, which you can modify, remove, and add to. Figure 2-10 shows this window
with a new ASP comment token that you could use to keep track of sections of code that have been
migrated from classic ASP pages.






Hiç yorum yok:

Yorum Gönder

Bing'ı Seviyoruz. :)
Google'ı Seviyoruz. :)