Mike Parks
Code.Where(c => c.IsTechnicalDebt).Refactor();

Metro-Bootstrap + jQuery + Overscroll

Just playing around with some jQuery. Pretty cool stuff :)

Metro-Bootstrap: http://talkslab.github.io/metro-bootstrap/
Overscroll: http://www.azoffdesign.com/overscroll

App 1

App 2

App 3

App 4

App 5

App 6

App 7

App 8

App 9

App 10

App 11

App 12

App 13

App 14


var codeReview = TFS.Features.First(feature => feature.IsAwesome);

If your team is currently on TFS 2010 and you're looking for an awesome reason to upgrade to TFS 2012, check this video out. Incorporating code reviews into the Visual Studio IDE will take your code quality and risk assessment to a whole new level. Everyone benefits from this. Good code reviewing results in clean code, happy software engineers, satisfied managers, faster future feature development, less maintenance, and obviously a little more time for ping pong, Xbox, and Mario Kart 64! That's a win.

Visual Studio Extensions - Mike Parks & Cory Cissell - Source Code Published

I've been contacted by a ton of people since Cory and I rolled out our Visual Studio Extensions asking if I could publish the source code to them. A large majority of the responses and feedback have been positive. It's awesome to see the development community using them! We haven't had time to maintain them but hopefully all our new friends that have contacted us will keep these alive and get some newer versions rolled out. 

106,958 downloads later!! And I've finally got around to publishing the source code! Go me. lol Enjoy!


Code PaLOUsa 2013!

Over the weekend my team and I attended Code PaLOUsa here in Louisville, KY. It's an awesome event and it really brought together the IT community around the area. I'm pretty proud to say that my new employer Zirmed  pitched in to help sponsor the event. It was great reuniting with all my old co-workers! Lots of familiar faces and I was very happy to see everyone has been doing so well in their careers. Hopefully they keep the tradition going and have this event next year! If you're a programmer around the Louisville area I highly encourage you check it out. Here's a high level view of the 3 day event schedule to give you an idea of what it consists of:

SQL Server Denali CTP 3 - Dockable Windows!

The future of SQL Server Management Studio looks pretty promising.

I downloaded SQL Server Denali CTP 3 the other day and was really happy to see that they've finally implemented dockable windows. I always find myself trying to drag the tabs out of SSMS 2008 to my 2nd monitor. Check it out if you get the chance. Just wanted to spread the word.

A little SQL tip for C# developers

The other day at work I came across a handy little block of SQL code from Jeremiah Clark's blog. It's pretty simple logic but through the mind of a C# developer making some quick DB updates, seems to me that it's more likely to end up writing out the code in Solution 1 instead of Solution 2 below to solve the problem.

Basically, I needed to check and see if a specific record existed in Table1. If it does exist, then update that record, otherwise insert a new record into Table1.

Solution 1:
IF EXISTS (SELECT * FROM Table1 WHERE Column1='SomeValue')
    UPDATE Table1 SET (...) WHERE Column1='SomeValue'
    INSERT INTO Table1 VALUES (...)

Solution 2:
UPDATE Table1 SET (...) WHERE Column1='SomeValue'
    INSERT INTO Table1 VALUES (...)
As Jeremiah explains, they both accomplish the same thing but from a performance standpoint, Solution 2 is the better way to go (saved table/index scan). Just wanted to throw this small tip out there. Thanks!

- Mike

Search Work Items for TFS 2010 Source Code Published on CodePlex

A little while back we published the Search Work Items for TFS 2010 extension in the Visual Studio Gallery. Noah Coad recently added Cory and I as Developers on the existing Search Work Items CodePlex project. Over the weekend I uploaded the new source code containing our Visual Studio and TFS 2010 updates. Feel free to check out the source code.

You can run the code locally but just be sure you have the Visual Studio 2010 SDK installed and you are pointing at your experimental instance of Visual Studio. To do this, just right click on the project in the Solution Explorer, click properties, click the Debug tab, then set the following properties:

Start external program: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Command line arguments: /rootsuffix Exp

Here's the link to the source code:

We're planning on publishing the source code to all our other extensions soon once we get some spare time. I'll post another blog once they're out there.

- Mike

Some handy tools - Copy As Path / Send To Toys

So I was reading through Cameron Skinners blog the other day and came across his post about the "Copy As Path" context menu option in Windows Explorer. Turns out this menu option is hidden unless you right click on a file while holding the shift key. It also turns out that this feature has been around for a while and I'm just now catching up :)


I thought this was pretty cool when I first found it but then I realized it always copied the path and wrappped it with quotes (Ex: "C:\Test.txt") I can understand why the quotes can be needed since paths can contain spaces but the quotes as a wrapper really should be an option. I couldn't find a way to disable this but after some quick googling I came across Gabriele Ponti's "Send To Toys". This tool simply adds extra context menu options to the Send To menu (one of them being "Clipboard (as name)"). In the config settings for this app, you can specify whether you want quotes or not. There's a few other cool send to options in there too. I had to download the 64 bit beta version since the 32 bit wasn't cooperating with my OS. This tool is probably not something that you'll be constantly using but it's always nice to have these small tools ready when you actually do need them. Check it out if you haven't already heard of it.

Our Visual Studio Extensions hit over 20,000 downloads!

A few months ago Visual Studio 2010 RTM was released. My friend Cory and I noticed a few features that would really come in handy but were not included in the release. After learning how to write extensions, we decided to create a few of our own. We used all of them locally for a while. Around April/May we decided to publish them to the Visual Studio Gallery so they can help other developers as well. Overall, I'm pretty satisfied with the outcome. We got a lot of good feedback on them and it seems like we've helped a lot of people. It's always nice seeing those 5 star reviews come in! The total download count for our 8 extensions as of now is 21,321! Obviously, I set my expectations too low on these projects because I figured the cumulative count would max out around 10k. Thanks to all that downloaded our extensions! If you haven't downloaded them, feel free to check them out and drop us a review on the VIsual Studio Gallery!

Here's the link to our extensions on the Visual Studio Gallery: http://visualstudiogallery.msdn.microsoft.com/en-us/site/search?f[0].Type=SearchText&f[0].Value=mike+parks&x=0&y=0

Go download the Visual Studio 2010 Productivity Power Tools!

If you're using Visual Studio 2010 as your IDE I'm sure you've heard that Microsoft just released an update to their Productivity Power Tools extension a couple days ago. If you haven't installed this yet, go do it now! It's packed with tools that will help you when programming in VS 2010. The best tool out of the set is called Solution Navigator. It's basically a beefed up version of the Solution Explorer. I'm not going to go into too much details here but I just wanted to provide the links below to get the word out there and spread the knowledge. The Productivity Power Tools already have 82,096 total downloads last time I looked. Well, go check it out! :)

Visual Studio Blog (update released): http://blogs.msdn.com/b/visualstudio/archive/2010/07/18/new-version-of-the-productivity-power-tools-is-available.aspx
Visual Studio Blog (info on Solution Navigator): http://blogs.msdn.com/b/visualstudio/archive/2010/07/20/solution-navigator-blog-post.aspx
Download Link: http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef


WCF & WPF Peer Channel Chat

A few days ago I was reading up on some WCF technology called Peer Channel. It looked pretty cool so I decided to try it out. I was pretty shocked to find out how easy it was to build a chat messaging service using this this stuff. I was able to run a chat client on my computer, a chat client on my friends computer, and the WCF Chat service on a server. We were able to send messages back and forth to each other (all on the same network of course). It worked pretty fast without using a lot of resouces on either computer or over the network. I threw a WPF interface on it to look nice, which was really easy to do as well. I just wanted to post up some of the code here on my blog in case anyone wanted to see how it works.

Client 1 and Client 2:

 Service that runs on the server:


 Only needed a few files to make it work:

 Here's the code to the important files:

PeerChannel – Client – App.config


<?xml version="1.0" encoding="utf-8" ?>
      <!-- chat instance participating in the mesh -->
      <endpoint name="ChatEndpoint" address="net.p2p://chatMesh/MyChatServer/Chat" binding="netPeerTcpBinding" bindingConfiguration="BindingCustomResolver" contract="MyChat.IChat">
        <!-- Refer to Peer channel security samples on how to configure netPeerTcpBinding for security -->
        <binding name="BindingCustomResolver" port="0">
          <security mode="None"/>
          <resolver mode="Custom">
            <custom address="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService" binding="netTcpBinding" bindingConfiguration="Binding3"/>
        <!-- You can change security mode to enable security -->
        <binding name="Binding3">
          <security mode="None"/>


PeerChannel – Client – ChatClient.xaml.cs


using System;
using System.DirectoryServices;
using System.Security.Principal;
using System.Windows;
using System.Windows.Input;
namespace MyChat
    public partial class ChatClient : Window
        PeerChat chat;
        public ChatClient()
        private void btnJoin_Click(object sender, RoutedEventArgs e)
            if (!String.IsNullOrEmpty(txtName.Text))
                chat = new PeerChat(txtName.Text);
                chat.OnChatOnline += new PeerChat.ChatOnline(chat_OnChatOnline);
                chat.OnChatOffline += new PeerChat.ChatOffline(chat_OnChatOffline);
                chat.OnJoin += new PeerChat.JoinChat(chat_OnJoin);
                chat.OnLeave += new PeerChat.LeaveChat(chat_OnLeave);
                chat.OnChat += new PeerChat.ChatSendReceive(chat_OnChat);
                string result = chat.Start();
                txtChat.Text += result;
        void chat_OnChat(string member, string msg)
            txtChat.Text += String.Format("[{0}] {1}" + Environment.NewLine, member, msg);
        void chat_OnLeave(string member)
            txtChat.Text += String.Format("[{0} left]" + Environment.NewLine, member);
        void chat_OnJoin(string member)
            txtChat.Text += String.Format("[{0} joined]" + Environment.NewLine, member);
            btnSend.IsEnabled = true;
        void chat_OnChatOffline(object sender, EventArgs e)
            txtChat.Text += String.Format("**  Offline" + Environment.NewLine);
        void chat_OnChatOnline(object sender, EventArgs e)
            txtChat.Text += String.Format("**  Online" + Environment.NewLine);
        private void btnSend_Click(object sender, RoutedEventArgs e)
            txtMessage.Text = String.Empty;
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
            if (chat != null)
        private void txtMessage_KeyDown(object sender, KeyEventArgs e)
            if (e.Key == Key.Enter)
                txtMessage.Text = String.Empty;

PeerChannel – Client – PeerChat.cs


using System;
using System.ServiceModel;
namespace MyChat
    [ServiceContract(Namespace = "MyChat", CallbackContract = typeof(IChat))]
    public interface IChat
        [OperationContract(IsOneWay = true)]
        void Join(string member);
        [OperationContract(IsOneWay = true)]
        void Chat(string member, string msg);
        [OperationContract(IsOneWay = true)]
        void Leave(string member);
    public interface IChatChannel : IChatIClientChannel
    public class PeerChat : IChat
        private bool IsConnected { getset; }
        string member;
        IChatChannel participant;
        DuplexChannelFactory<IChatChannel> factory;
        public delegate void JoinChat(string member);
        public delegate void ChatSendReceive(string member, string msg);
        public delegate void LeaveChat(string member);
        public delegate void ChatOnline(object sender, EventArgs e);
        public delegate void ChatOffline(object sender, EventArgs e);
        public event JoinChat OnJoin;
        public event ChatSendReceive OnChat;
        public event LeaveChat OnLeave;
        public event ChatOnline OnChatOnline;
        public event ChatOffline OnChatOffline;
        public PeerChat(string member)
            this.member = member;
        public string Start()
            string result = String.Empty;
            InstanceContext instanceContext = new InstanceContext(this);
            factory = new DuplexChannelFactory<IChatChannel>(instanceContext, "ChatEndpoint");
            participant = factory.CreateChannel();
            IOnlineStatus ostat = participant.GetProperty<IOnlineStatus>();
            ostat.Online += new EventHandler(OnOnline);
            ostat.Offline += new EventHandler(OnOffline);
                IsConnected = true;
            catch (CommunicationException)
                result += "Could not find resolver." + Environment.NewLine +
                    "Please make sure the Chat Server is running before using this chat client." + Environment.NewLine +
                    "Refer to the readme for more details." + Environment.NewLine;
                IsConnected = false;
                return result;
            return result;
        public void SendMessage(string message)
            participant.Chat(member, message);
        public void End()
                if (IsConnected)
                    if (participant != null)
                    if (factory != null)
                IsConnected = false;
            catch (Exception)
        public void Join(string member)
            if (OnJoin != null)
        public void Chat(string member, string msg)
            if (OnChat != null)
                OnChat(member, msg);
        public void Leave(string member)
            if (OnLeave != null)
        public void OnOnline(object sender, EventArgs e)
            if (OnChatOnline != null)
                OnChatOnline(member, e);
        public void OnOffline(object sender, EventArgs e)
            if (OnChatOffline != null)
                OnChatOffline(member, e);


PeerChannel – WCF Service Console – App.config


<?xml version="1.0"?>
      <service name="System.ServiceModel.PeerResolvers.CustomPeerResolverService">
             <add baseAddress="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService"/>
        <!-- use base address provided by the host -->
            <endpoint address="net.tcp://SERVERNAMEGOESHERE/MyChatServer/peerResolverService" binding="netTcpBinding" bindingConfiguration="Binding1" contract="System.ServiceModel.PeerResolvers.IPeerResolverContract"/>
          <!-- You can change security mode to enable security -->
          <binding name="Binding1">
              <security mode="None"/>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>


PeerChannel – WCF Service Console – DefaultCustomResolver.cs


using System;
using System.ServiceModel;
using System.ServiceModel.PeerResolvers;
namespace MyChatServer
    class DefaultCustomResolver
        public static void Main()
            // Create a new resolver service
            CustomPeerResolverService crs = new CustomPeerResolverService();
            crs.ControlShape = false;
            // Create a new service host
            ServiceHost customResolver = new ServiceHost(crs);
            // Open the resolver service 
            Console.WriteLine("Custom resolver service is started");
            Console.WriteLine("Press <ENTER> to terminate service");


Work Item Visualizer for TFS 2010 - New Extension

I released another new extension to the Visual Studio Gallery again today called Work Item Visualizer for TFS 2010. I've only heard positive things about it so far, hopefully it stays that way :) Basically, it creates a diagram of all work items linked to a work item ID which the user specifies in a search box. This extension was coded using DGML (the same graph rendering language used for the Visual Studio 2010 Architecture Tools). It was pretty cool getting a chance to create something using some of the newest technology out there. Well, I just wanted to throw a blog up to get the word out on it a little more. If you're using Visual Studio 2010 with Team Foundation Server 2010, feel free to check it out! Thanks everyone.

Download Link: http://visualstudiogallery.msdn.microsoft.com/en-us/a35b6010-750b-47f6-a7a5-41f0fa7294d2


What it does:

·         Creates a DGML graph to visualize linked TFS Work Items by entering a Work Item ID in the toolbar search box


How it benefits you:

·         Allows you to easily analyze the hierarchy of your TFS Work Items

·         Gain the ability to perform basic risk/impact analysis when creating or editing Work Items

·         Great for meetings in the case that you need to discuss the entire scope of linked Work Items

·         Easier project planning

·         Eliminates the need to create TFS queries or reports to view tree of Work Items

·         Easily lets you see the entire tree of work items linked to the one you’re working on


Navigation Tips:

·         Use Ctrl + Mouse Wheel Scroll to zoom in and out

·         Use Ctrl + Left Mouse click (and hold) to move document around

·         Right click on DGML area for more options (Like copy image or viewing in groups)

·         Clicking on each node highlights that node and the links connected to it

·         Colors in the legend can be changed

·         When work item nodes are deleted, the view is automatically updated

·         Double clicking on work item node will open up the Work Items URL


Try it out on work items that have several of links and let us know what you think. A big thanks goes out to everyone working on the http://visualization.codeplex.com/ project for publishing the source code on CodePlex which really helped me learn how DGML (Directed Graph Markup Language - New to Visual Studio 2010 Architecture Tools) works!


 - Mike

Search Work Items for TFS 2010 - New Extension

A few months ago I was constantly using Visual Studio 2008 with Team Foundation Server 2008. Searching for work items with queries inside Visual Studio became a pain until I found an add in that simplified it into one little search box in the IDE.  It allowed me to enter some text in, hit the enter key, and it would bring back a list (aka open a .wiq file) of work items that matched the text entered. I became a huge fan of Noah Coad's Search Work Item Add In. He wrote a pretty good blog on how to use it as well.

Of course when we upgraded to Visual Studio 2010 and Team Foundation Server 2010, the 2008 add in no longer worked. I didn't see any updates for it on codeplex to be 2010 compatible. Cory Cissell and I have published a few Visual Studio Extensions already so I figured I'd take a shot at making this tool 2010 compatible by turning it into an extension. Sure enough, it worked. We used it locally for a while and recently decided to publish it to the Visual Studio Gallery.

If you are currently looking for an easy way to search work items in Visual Studio 2010, this is worth checking out. Big thanks goes out to Noah for originally creating this on codeplex.

The extension we created can be downloaded here: http://visualstudiogallery.msdn.microsoft.com/en-us/3f31bfff-5ecb-4e05-8356-04815851b8e7



 * Additional note: The default search fields are Title, History, and Description. If you want to modify which work item fields are searchable, type in "--template" (no quotes) into the search box and hit enter. This will open the search template. Just add another "Or" statement, pick the field name, select an operator, type "[search]" (no quotes) in the value field, and hit ctrl + s to save. The next time you run a search it will use the modified search template.

That's all for now. Thanks!

- Mike

New Bing Maps

Normally I don't stray too far from Programming and TFS on my blog posts but I'm just really impressed with how much Silverlight has improved Bing maps. I use to be big on MapQuest, then hopped over to Google, but now the new Bing Maps have everything I need.

The two coolest features are right on the main page. All you have to do is go to http://www.bing.com/maps/explore/, enter your city and hit enter in the search box, then look in the lower left corner under the EXPLORE section. Check out the "What's nearby" and "Restaurants" links. The best part is, if you're interested in doing any Silverlight programming, they have a Bing Maps Silverlight Control Interactive SDK. I was thinking about coding something....but they've pretty much got it down :) Pretty impressive stuff.




TFS 2010 Auto Shelve Extension

We've been working with the Visual Studio 2010 SDK and the TFS 2010 SDK a lot recently to create new Visual Studio Extensions. You can find these extensions in the Visual Studio Gallery. If you're a developer/programmer, you should check it out, they have some pretty cool tools out there. I'd be surprised if you told me you went there and couldn't find any tools that could help you.

One of the new extensions Cory and I made is called TFS Auto Shelve. Check out the description and read about it below. If you're interested and you have VS 2010 w/TFS 2010, feel free to try it out and let us know what you think.

You can download it here: http://visualstudiogallery.msdn.microsoft.com/en-us/080540cb-e35f-4651-b71c-86c73e4a633d


Here's a description and screenshots:

Protect your code by guaranteeing your pending changes are always backed up to the TFS server.

 What it does:

  • Automatic Shelving shelves all your pending changes while you are coding
  • Manual Shelving shelves all your pending changes anytime with a single menu click or Ctrl+T hotkey
  • Uses one shelveset per workspace to shelve all pending changes to the TFS Server
  • Shelvesets are re-used to save the latest version of pending changes


  • Automatic Shelving
    • Begins when any solution mapped to TFS is opened in Visual Studio
    • Disabled when non-mapped TFS solution is opened
    • Team Menu allows you to turn on/off automatic shelving
      • Team Menu -> TFS Auto Shelve (Running)
      • Team Menu -> TFS Auto Shelve (Not Running)
  • Manual Shelving
    • Can be triggered any time as long as you are connected to TFS
      • Team Menu -> TFS Auto Shelve Now
  • Options
    • Tools Menu -> Options -> TFS Auto Shelve Options
      • BaseName – This name is automatically followed by the workspace name to create a unique shelveset name. By default it’s “TFS Auto Shelve”.
      • TimerSaveInterval – The interval (in minutes) which automatic shelving will occur

 Helpful Info:

  • To view shelvesets, open Source Control Explorer, click on:
    • File > Source Control > Unshelve Pending Changes
  • Workspaces can be modified by:
    • Opening the Source Control Explorer > Clicking on Workspaces drop down > Click Workspaces… > Click Add/Edit/Removed
  • Custom Visual Studio Activity Logging is implemented. If you run into any errors, please startup Visual Studio with the /log switch, re-create the error, then close Visual Studio. You can browse to “%AppData%\Microsoft\VisualStudio\10.0\ActivityLog.XML” to view the log. Please feel free to inform us of any errors you see and we can work it out via email.



- Mike

Visual Studio 2010 - Faster Startup with /nosplash

I read a blog the other day about the /nosplash switch in Visual Studio. Apparently, it's been around a while and I'm a little late on finding out about it. I figured I'd share it for those of you that come across this and didn't know about it as well. Basically all it does is turn off the Visual Studio splash screen which speeds up initial startup time. It's not a big difference but every little bit helps. I choose speed over looks. You can set the switch by right clicking on Visual Studio, selecting Properties, and adding "/nosplash" on the target Property, so it will look like this: "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /nosplash.

Feel free to try it out and see if you like it. You can always change it back by just removing the /nosplash switch when you're done testing. There are plenty more Visual Studio switches out there but this is the main one that came in handy for me.


- Mike

Visual Studio 2010 Modeling and Architecture Tools

Jennifer Marsman (Microsoft Evangelist) and Cameron Skinner (Microsoft Visual Studio Product Unit Manager) recently stopped by our office while they were passing through Louisville on their tour to give us a presentation on the new Visual Studio 2010 Modeling and Architecture Tools.

I checked out these new features when Visual Studio 2010 Beta versions originally rolled out and have been really impressed with this stuff ever since then. So it was pretty cool to actually learn some new techniques from Cameron himself since he helped write the actual code behind some of those features. If you've upgraded to Visual Studio 2010 recently I would highly recommend using the Architecture tools. They're awesome. If you want to make improvements to it, they even have their own SDK for it. There are plenty of blogs out there to show you how to use it. I've been waiting to find a tool that works like this where I can really analyze the code in solutions and projects and see how everything ties together.

It's really handy if you're asked to work on a new project and aren't familiar with how it works. Just run the tools, analyze the DLL's, learn how everything works, and then you'll be ready to implement new code! It's a great tool to learn new systems quick and easy and it's all housed within the Visual Studio IDE. I just wanted to write a blog to brag about it a little bit, so I figured I'd throw this up here. It's a must have tool for Developers/Architects. Here's some screenshots of when I was using it earlier:


Thanks everyone!

- Mike

New Visual Studio 2010 Extension - Collapse Solution

If your team has recently upgraded to Visual Studio 2010, take a second to check out the new Extension Manager. You can use it to browse through or install tons of tools, controls, or templates from the Visual Studio Gallery.

My friend, Cory Cissell, and I recently teamed up and created an extension of our own called "Collapse Solution". It adds an option called Collapse Solution to the context menu of the solution node in the solution explorer. It also adds an option called Collapse Project to the context menu of each project node in the solution explorer. When that option is clicked, it will walk through the solution explorer tree and collapse any expanded child nodes in that section (projects, folders, code behind files, designer files, etc.). I use to have an add-in that did this in Visual Studio 2008 but it wasn't compatible when we upgraded to 2010 so we decided to write our own. The old tool was also packaged with a bunch of other junk that we didn't need so we figured it would be a much cleaner tool if it was broken off into its own extension. There's no need to install extra tools if you don't really need them.

So if you have upgraded to Visual Studio 2010, please feel free to try out our Collapse Solution extension and leave us a rating/review in the Visual Studio Gallery. Thanks!

Here's the link: http://visualstudiogallery.msdn.microsoft.com/en-us/2d81fec6-71f3-4fa5-87b4-c2aa18e42f92

- Mike


Visual Studio 2010 Beta 2!

We recently had Stephen Toub, a Senior Program Manager on the Parallel Computing Platform team at Microsoft, swing by our office and walked us through some really cool ways to start implementing parallel programming using Visual Studio 2010 and the 4.0 Framework. I'm thankful that I had the opportunity to attend this, it was one of the best presentations I've ever seen. It's exciting to see the technology evolving :)

Anyway, during his presentation we caught a lot of Visual Studio 2010 Beta 2 in action. There's a bunch of cool improvements and everything seems a lot faster and more responsive. TFS 2010 is also available for download on Microsoft's web site. The links have been changing around since it's been released but here's where it's all currently at:


Check it out!

- mike

TFS - View all pending changes for all users

Team Foundation Server allows you to see who has what file checked out at any time.  If you would like to see a list of files that any TFS User has checked out, follow the steps below:

  1. Open Visual Studio 2008 > Click File > Source Control > Find In Source Control > Status
  2. Select "Display all checked out" or "Display files checked out to" (to filter changes by user)
  3. Hit Find
The screenshots below show the type of results you should expect.  Another great way to get this info is by using Team Foundation Sidekicks. If you go this route, you will be able to export the results to a spreadsheet to make them easier to work with. I had to use this the other day to generate a list of all files that were checked out by multiple users. It was easy to work with the data once I got it in Excel.  If you prefer getting these results from the command line, you can use the tf status command in the Visual Studio 2008 command prompt as another option to view pending changes by TFS Users.

TFS - Undelete File or Folder

If you ever need to undelete a file/folder in TFS, here's how you can do it. I found a couple of people who didn't know this feature existed so I figured I'd throw a blog up about it.
  1. Open Visual Studio > Click Tools > Options > Source Control > Visual Studio Team Foundation Server
  2. Check Show deleted items in the Source Control Explorer, hit OK
  3. Right click on deleted file/folder in Source Control Explorer
  4. Click Undelete
  5. Check In

TFS Auto Shelving


For Visual Studio 2010 / TFS 2010 please see:  http://geekswithblogs.net/MikeParks/archive/2010/05/12/tfs-auto-shelve---new-visual-studio-2010--tfs.aspx

In one of our meetings the other day a few developers on our team asked if there was an Auto Shelve feature in TFS to shelve their pending changes automatically each night. I couldn't find anything in the Visual Studio 2008 IDE that allowed us to do this.  After some research, I did find a work around.

Basically, I just created a batch file that uses the Visual Studio 2008 Command Prompt to run tf shelve on the highest level folder of your local TFS workspace mapped on your C drive. It uses tf shelve to create a TFS shelveset called "Daily Backup - Your Name".  It will replace that same shelveset every day with all your current changes (or however often you have the Windows Scheduled Task runs).

This way, you will always have a backup copy of your daily changes. It's always nice to be on the safe side, even if you think you don't need it.  A few developers have had their machines crash on them and had to have the machine re-imaged. This would have came in handy back then.  I could have built a custom TFS add-in or app, but I figured this was extremely easy to just use a batch file and windows task.  Anyway, to set this up, just follow the steps below:

  1. Open notepad and paste these two lines in:

    call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat"
    tf shelve "Daily Backup - YOUR_NAME" /noprompt /replace > "C:\TFSBackupLogFile.txt"
  2. Edit the title in the 2nd line to include your name and edit the path at the end of the 2nd line to map the log file
  3. Save the file to your desktop (or anywhere you'd like) and name it TFSBackup.bat
  4. Click Start > Control Panel > Scheduled Tasks > Add Scheduled Task
  5. Walk through the scheduled task Wizard and point it to the TFSBackup.bat file you created
  6. Set the Task to run daily at whatever time you want
  7. Run the task to make sure it runs executes the bat file successfully and check TFS to make sure your shelveset was created

You can view TFS Shelvesets by opening Visual Studio > File > Source Control > Unshelve Pending Changes.




Visual Studio TFS Work Item Search Plugin

If you're accessing work items in Team Foundation Server from the Visual Studio IDE, you will end up using this plugin more than you might think.  I'm surprised they only have 3194 downloads. It basically does exactly what it says.  You can either type in a work item ID to immediately bring up the work item, or type in text to search through work items (like a word or two that would be in the Title or Description).  If you're using Visual Studio 2008, check it out. Here's the link to where it lives on codeplex:


- mike

Bing vs Google

If you're a big search junkie, check out this site: http://www.bing-vs-google.com/. It's the best comparision tool that I've seen out there so far that will really let you see the differences between the two huge search giants in the industry.

Developers love tools :)



TFS - Deploying To Multiple Environments Using Team Build

Using TFS and Team Build to deploy to Development, Integration, QA, Stage, Pre Production, or any other testing servers you have can be quite a bit of a challenge sometimes. I haven't really found a lot of documentation or best practices out there for it either. There are plenty of ways to move the files across each environment. I'm going to try this build definition out for a while and see how well it works. 

When I queue a new build definition up, I'm going to pass in the following parameters (they will be different each time I queue a new build so I can specify exactly what I need):

These parameters are used to tell my build definition which source control version I want to build and which environment I want to deploy the files to.  The GetVersion parameter can accept a changeset number, label, date, "W" (Version last fetched to your workspace), or "T" (latest version).  The DeployTo parameter can accept Dev, QA, or Stage. You can also default the parameters by setting the values in the .rsp file. See the following links for more information on how these are being used:

Building a Specific Version with Team Build 2008
MSBuild Conditional Constructs

Here's a sample build definition that uses the parameters:

<?xml version="1.0" encoding="utf-8"?>

<!-- DO NOT EDIT the project element - the ToolsVersion specified here does not prevent the solutions

     and projects in the SolutionToBuild item group from targeting other versions of the .NET framework.


<Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />















    <WorkItemFieldValues>System.Reason=Build Failure;System.Description=Start the build using Team Build</WorkItemFieldValues>

    <WorkItemTitle>Build failure in build:</WorkItemTitle>

    <DescriptionText>This work item was created by Team Build on a build failure.</DescriptionText>

    <BuildlogText>The build log file is at:</BuildlogText>

    <ErrorWarningLogText>The errors/warnings log file is at:</ErrorWarningLogText>









    <When Condition=" '$(DeployTo)'=='Dev' ">





    <When Condition=" '$(DeployTo)'=='QA' ">





    <When Condition=" '$(DeployTo)'=='Stage' ">








    <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Websites/MikesWebApplication/MikesWebApplication.sln">







    <ConfigurationToBuild Include="Release|Mixed Platforms">


      <PlatformToBuild>Mixed Platforms</PlatformToBuild>




  <Target Name="AfterDropBuild" >


    <!--Delete Previous Deployment-->

    <CreateItem Include="$(DeployPath)\**\*.*" Exclude="$(DeployPath)\**\Web.Config">

      <Output ItemName="PreviousDeployment" TaskParameter="Include" />


    <Delete Files="@(PreviousDeployment)" ContinueOnError="true" />


    <!--Define New Deployment Files To Be Copied-->


      <Compile Include="$(DropLocation)\$(BuildNumber)\Mixed Platforms\Release\_PublishedWebsites\**\*.*"

               Exclude="$(DropLocation)\$(BuildNumber)\Mixed Platforms\Release\_PublishedWebsites\**\Web.Config"/>




    <Copy SourceFiles="@(Compile)" DestinationFolder="$(DeployPath)\%(RecursiveDir)"></Copy>




Hope this helps! Leave me some feedback if you get a chance. Thanks everyone.