Visual Studio Tip: Using the Task List Pane

March 3rd, 2010 No comments

I was in a meeting the other day and a question came up about the purpose of the Visual Studio Task List. A couple of the developers had never used it before, so I thought it’d be a good topic for the blog.

Task List tab in Visual Studio

The Task List, by default, appears in the bottom left window pane of Visual Studio (the same place where build errors and warnings appear). Alternatively, you can find it under the View menu. Microsoft provides some basic documentation on the Task List feature here. However, the documentation glosses over some developer best practices, so I thought I’d expand on that a little.

NOTE: Before I go further, I want to preface everything by saying that the task list should not replace more robust work tracking systems, like TFS Work Item Tracking, Microsoft Project or another 3rd party product backlog or issue tracking solution. That said, the Task List can be used to define more granular programming tasks that may not be appropriate in a higher-level work tracking system.

Code Comments vs. User Tasks

Two types of tasks can be captured in the Task List pane: User Tasks and Code Comments.

User Tasks provide generic notes that a developer may want to remember during development. They work pretty much like Outlook Tasks do, except without any of the features that make Outlook Tasks useful. After about five minutes, you’ll quickly realize just how limited User Tasks are. I usually stay away from User Tasks because

  • Most of what I have used them for, I should be putting in an Issue Tracking / Work Item Tracking system.
  • User Tasks are not stored in version control; therefore, other developers cannot see them and I lose them if I delete my local working environment.

Let me spend a moment longer on that last bullet, because I think that’s an important point.

User Tasks are stored in the developer’s *.suo file, which is not stored in source control by default (nor should it be). The *.suo file contains user-specific settings, such as the state of the Solution Explorer, which should not be shared across developers or environments. When another developer opens a solution for the first time, a new *.suo file is created automatically.

This leads us to Code Comments, which are much more useful. Code comments are literally comments in your code have are prefaced with a pre-defined tag. Creating code comments is a very straight-forward activity:

'VB.NET
Try
    'some code here
Catch ex as Exception
    'TODO: Need to implement roll-back feature in transaction.
    Throw
End Try
// C#
Try {
    // some code here
}
Catch ex as Exception {
    //TODO: Need to implement roll-back feature in transaction.
    throw ex;
}

By preceding a comment with “TODO”, it automatically appears in the Task List. As you can see below, it is possible to see all code comments within your project/solution at once:

Image of task list pane

Task List pane with all-important programming tasks

Code Comments improve upon User Tasks in a variety of ways. For example, code comments allow you to “bookmark” your code in case you need to come back to it later for refactoring or a re-design. Also, code comments are in source code. Source code is stored in version control and shared among the development team. See where I’m going with this?

I hope this helped shed some light on another little feature of the Visual Studio IDE.

VS 2010 Now Arriving April 12th!

January 15th, 2010 No comments

News is out about the new launch date for Visual Studio 2010.  The new date (if you didn’t figure it out already…) is April 12, 2010.   Nice to finally have a specific date to look forward to.

Categories: Visual Studio Tags:

Certified

December 16th, 2009 1 comment

Microsoft Certified Professional logoYesterday, I took (and passed) the Microsoft Certification exam 70-536 (Technology Specialist: .NET Framework – Application Development Foundation).  Three months worth of studying and it finally paid off.

Just wanted to share. = )

Categories: .NET, Misc Tags:

TFS API: How to Get a Specific Version Programmatically

December 4th, 2009 No comments

Within the Visual Studio Source Control Explorer, there are a number of options available for getting files out of TFS. Often times, developers just want to get the latest code to work with. But in some scenarios, developers need to get source files based on alternate criteria, such as by a specific date or label.  TFS provides a handful of options for selecting source files easily within the “Get Specific Version” dialog.

TFS: Get Specific Version Options

This works really well within Visual Studio, but how can you do this programmatically?  As it turns out, the Workspace.Get() method has an overloaded method that takes a VersionSpec argument.  Notice that VersionSpec is actually a base class. and that there are several inherited classes that can be used to specify the changeset type, including:

  • ChangesetVersionSpec
  • DateVersionSpec
  • LabelVersionSpec
  • LatestVersionSpec (equivalent to VersionSpec.Latest)
  • WorkspaceVersionSpec

For example, if you wanted to perform a GET on a specific changeset, you would simply pass an instance of ChangesetVersionSpec:

'connect to source control and get reference to existing workspace
Dim tfs As New TeamFoundationServer("http://myTfsServer:8080")
Dim vcs As VersionControlServer = _
      DirectCast(tfs.GetService(GetType(VersionControlServer)), _
                 VersionControlServer)
Dim ws As Workspace = vcs.GetWorkspace("MyExistingWorkspace", My.User.Name)

'Perform a GET on Changeset 100
Dim version As New ChangesetVersionSpec(100)
ws.Get(version, GetOptions.GetAll)

Performing a GET based on a pre-defined label works in much the same way (just replace the ChangesetVersionSpec object with a LabelVersionSpec object):

'connect to source control and get reference to existing workspace
' (same as above)...

'Perform a GET on items defined by label "My Label"
Dim version As New LabelVersionSpec("My Label")
ws.Get(version, GetOptions.GetAll)

Visual Studio 2010 News from Microsoft

October 21st, 2009 No comments

For those of you keeping tabs, Microsoft recently released a slue of information regarding the next versions of Visual Studio and Team Foundation Server.

Some of the highlights…

  • The official release date for Visual Studio 2010 is March 22, 2010.  This and some other announcements can be heard on the latest Radio TFS podcasts.
  • Visual Studio 2010 Beta 2 was released on Monday (Oct. 19th) to MSDN Subscribers.  The aforementioned podcast also hinted that a Virtual PC image with VS 2010 Beta 2 made be released shortly.  If not, Brian Keller has posted another video on how to download and install the Beta 2 software.  Between this and information from my previous post, you should be able to set up a Virtual PC image with the correct bits.
  • Expect to see a lot of new webcasts on Visual Studio 2010 at Channel 9 in the coming days/weeks.
  • Microsoft also announced that they are revamping their licensing structure to correspond with the new version.  Brian Harry discusses this in more detail on his blog.

Lots of exciting news out of Microsoft.  I was kind of hoping that they’d release this yet in 2009, but I’m glad they’re taking the extra time to work out the bugs rather than rush the product to production too early.

Microsoft Windows and ASP.NET Tutorial Sites

October 9th, 2009 No comments

I’ve been a fan of the Microsoft’s ASP.NET site for a while now.  If you’re not familiar with it, the site contains an awesome amount of information and resources for ASP.NET developers.  One of my favorite features of this site is the Learning section, which contains a large number of tutorial videos covering a range of different technologies, tools and controls within the realm of ASP.NET development.  While the videos are not usually in-depth on any single topic, they do provide great introductory examples to help me get past a lot of my initial hurdles and start developing something to cater to my specific needs.

Today, I came across theWindows Forms and WPF equivalent of the ASP.NET site, and I was amazed that I hadn’t thought to look sooner.  This site has the same great information and resources I was used to seeing for ASP.NET.  And this site also has a large number of video tutorials, both catering to the traditional Windows Forms developers as well as those moving into the WPF space.

This site has already made its way onto my list of useful work resources.  Today’s video was a review on how to use the BackgroundWorker class to simplify multi-threading.

Categories: .NET Tags: , , ,