24 August 2011

Team Explorer Profile Manager–Take 1

If there is one thing I can generally count on doing at least once a day it’s firing up Visual Studio 2010.  Along with Visual Studio 2010 I am also a heavy user of Team Foundation Server 2010.  I use it at my “day job” as well as at home on “side” projects.  At work, I switch among multiple Team Project Collections and Team Projects relatively frequently.  At home, more so because I tend to work with several CodePlex projects as well as local TPCs and Team Projects on my development laptop.

[UPDATE: A new release is available – see Update History below…]

If this sounds like you then you’ve no doubt experienced the pain of having to continually switch TPCs in Visual Studio Team Explorer.  It goes something like this:

  1. Fire up Visual Studio 2010
  2. Click on the Team Explorer tab only to realize that the project you need is in another TPC
  3. Click on the “Connect to Team Project” icon and switch TPCs and select the desired Team Projects
  4. Click the confirmation dialog warning you that connecting to another TPC will close all queries, etc.
  5. While working, you decide to open another instance of Visual Studio to take a look at a different project
  6. You click on the Team Explorer tab only to realize, that once again, you’re connected to the wrong TPC so you repeat steps 2 – 4
  7. And so on…

Wouldn’t it be nice if you could simply launch Visual Studio and have it connect to the TPC and Team Projects you need from the start?  Well, that’s where the Team Explorer Profile Manager (TEPM) comes in.  I wrote this utility to handle exactly this scenario.

What Is TEPM?

Once you run TEPM it sits in the Windows “system tray” area waiting for you to right-click on it.  Once you do, you will see a menu structure something like this:

image

Based on the menu items seen above you might have guessed that TEPM works on the basis of “profiles”.  A profile is simply a snapshot of the Team Explorer settings taken at a given time.  Here’s how it works:

  1. Fire up Visual Studio 2010 (TEPM currently works only with Visual Studio 2010)
  2. Connect to the desired TPC and select the active Team Projects you wish to work with
  3. Right-click on the TEPM icon to get the above menu and select “Manage Profiles”.  This will display the following dialog allowing you to name the profile for the current Team Explorer settings:

    image
  4. Once you’ve entered a profile name (using only valid filename characters) click on the Copy button to create the profile.

Repeat the above steps for the various TPCs and Team Projects you regularly work with.

Now, when you right-click on the TEPM icon to get the above menu, hover over the Launch Saved Profile menu option to display a list of profiles.  For example:

image

Notice in the screenshot above, I have six profiles configured.  Selecting a profile will launch Visual Studio 2010 with the correct Team Explorer settings.  So the next time you need to fire up Visual Studio 2010 to work in a TPC different from what you’re currently working in simply right-click and launch!

Some Other Info

TEPMAboutLogo2This is a “v1.0” product.  It works (at least for me) and should work for you.  You may encounter bugs and, if you do, I would really like to know about them so I can fix them.  The first time you run TEPM it will create a “baseline” profile that matches your current settings.  You can revert to this baseline at any time by selecting the Launch Baseline Profile menu item.  You can also reset the baseline to a specific profile by clicking on the Create Baseline button in the “Manage Profiles” dialog shown above.

Currently, there is no option for running this utility when you first logon to Windows.  I plan to add this soon but just haven’t done it yet.[done]  If there are any other options that you’d like to see, please let me know.

There is also no installation package at this time (e.g. no MSI).  I plan to add that soon as well but for now, the download is simply a ZIP file that contains a single EXE.  Copy the EXE to the desired location on your machine and double-click it to run it.[done]

Download

Eventually, this will be hosted on the Visual Studio Code Gallery.  Until I get it there, you can download the ZIP file from here.

Please let me know if you have any questions, suggestions, criticisms, etc.

Update History

  • 30 August 2011 – Miscellaneous updates, including:
    • Now packaged as a setup file.  You no longer need to manually copy the file to a directory to install it.
    • Added a Settings dialog with the option to automatically run TEPM on startup
    • Double-clicking the TEPM icon will now launch Visual Studio 2010 using the current profile
    • Removed the “Copy Current Profile” menu option and merged into “Manage Profiles”
  • 24 August 2011 – Version 1.0 Published

16 August 2011

Indent Guides in Visual Studio 2010

A short while back, I blogged about some of my favorite Visual Studio extensions.  Recently, I discovered another (free) extension that I’ve really learned to love – the Indent Guides extension.  This extension does exactly what it says, it provides visible “indent guides” within the Visual Studio source code editor allowing you to easily track various levels of indentation throughout your source code.

My favorite feature of the extension is the ability to modify the look of the indent guide lines at each level of indentation.  As you can see in the screenshot below, I’ve modified the guide lines for the 2nd level of indentation to be a red, dashed line (instead of a teal, dotted line).  This allows me to easily see the “top” level of the current method I’m currently modifying even if I can’t see the top or bottom curly braces for the method.

image

There are various other options that you can play with as well.  Just go to Tools->Options and select Indent Guides.  This is a basic extension but is very well done and the author has been very responsive to questions posted on the Visual Studio Gallery link.

Read more about this extension and/or download it here.

09 August 2011

.NET Framework 4 Update (KB2468871)

Microsoft has released a GDR (General Distribution Release) update (KB2468871) that rolls all previous hotfixes – or QFEs (as of a couple of months ago) – into a single update.

This update replaces the following hotfixes:

  • 2183292 "Failure sending mail" error message when you send an email message by using a .NET Framework 4-based application that uses the "System.Net.Mail.SmtpClient" class if the email attachment is larger than 3 MB
  • 2413613 A shortcut menu may appear far away from the mouse pointer when you run a Windows Presentation Foundation application that is based on the .NET Framework 4
  • 2298853 Visual Studio 2010 error: "Error 1 error MSB4014: The build stopped unexpectedly because of an internal failure"
  • 2461678 A .NET Framework 4-based WPF application crashes if the source object of a data binding in a control is an element that is defined outside the name scope of the control

There are also several other issues that have been resolved in this GDR which are covered here.

Get this update here and/or read more about it on Buck Hodges’ blog here.

03 August 2011

Version Control Changes Coming to TFS v.Next

For many of using Team Foundation Server on a daily basis, living with the TFS workspace has been a love/hate (mostly hate?) relationship.  A simplistic definition, if you’re not familiar with TFS’ workspace, is that it is a mapping of a selection of files within TFS version control to their corresponding destination on your local file system along with various related status information.  This workspace mapping is stored on the server – not the client (i.e. server workspace).

The down side is that it is relatively easy to get your local file system out of sync with what TFS thinks it knows (about the status of the mapped files).  If you delete a file on your local file system, TFS has no idea that the file has been deleted.  If you modify a file on your local file system (assuming you remove the “read only” attribute) then TFS has no idea about that change.  These examples, along with others not listed, adds to some of the greatest confusion when learning to use TFS version control for the first time.

On the up-side, the beauty of the server workspace is that TFS will send down only the files necessary based upon your request (i.e. “Get Latest”).  This can be very useful if you’re working across a WAN/VPN connection where bandwidth is at a premium.

Enough about the current state of affairs.  Now, the good part… Brian Harry has posted some details around some of the enhancements being made to version control with the next release of Team Foundation Server (a.k.a. “Dev11”).  In this post, he discusses the addition of the “Local Workspace” which allows you to make changes directly to the files within your file system and TFS will automagically recognize and handle those changes.  This will provide SVN-style version control capabilities with TFS.  Server workspaces will still exist but the local workspace will become the default.

Check out Brian’s post for all the nitty gritty details.