TFS Integration for Source Control in Blend 4, and why it might not be working for you

by Grank May 28, 2010 11:03

Since I haven't written here in a while, I thought I'd toss out this quick tip while it's on my mind.

Working with Expression Blend for WPF or Silverlight can be gratifying.  Sketchflow in particular is a great way to rapidly develop clickable prototypes.  Of course, especially if you're working on a Blend project as a team, you'll want to be using version control with a source repository.  Turns out that Blend 4 has TFS 2010 integration built in (and it can be enabled for Blend 3 via patches for both Blend and TFS 2008).

However, if you're working in Blend, you may find the path to that a little convoluted.

See, you can't actually initially add a project to source control from within Blend. 

At first, I had created the project in Blend, and then when we got to the point where wanted to work on it as a team, we used the Source Control Explorer in Visual Studio 2010 to map the path and check the files into TFS source control.  However, there was no integration with Blend, which was painful, as files would have to be manually checked out through Visual Studio and then manually checked back in.  More painfully, new files added to the project would not be picked up and would have to be manually added. 

This frustrated me enough (and made me start worrying about potentially sticky bad-merging scenarios) to see if the Internet knew of any way to make Blend behave the same way as Visual Studio does with regards to source controlled projects... only to find that it's supposed to already be a part of Blend 4.  So why wasn't it working?

After a little poking and prodding, I finally realised that although the files were in source control, the solution and project files were not BOUND to source control.

This is not something you can accomplish via Blend.  However, if you close Blend, open the solution in Visual Studio, go to File > Source Control > Change Source Control..., select each item listed and click Bind, since the containing folder is already mapped to a source repository folder and the solution and project files are in source control it'll pick up the correct binding.  Save and close Visual Studio, and then open the solution in Blend again, and voila!  Blend is now aware of TFS!  You can check files in and out manually from the Projects pane, files will automatically be checked out when you edit them in Blend, and new files added to the project will automatically be added to source control, just like in Visual Studio.

This is one of those things that seems really self-evident after you recognize it, but you might be like me and not recognize it right away.  So here it is blogged for the benefit of your Google search results.

Comments

6/14/2010 5:41:29 AM #

Sunshine

Thank you for posting this!  Initially I didn't see any functionaliy in Expression in any way related to TFS.  The reason was that I simply added the new Expressions solution files to TFS from the Source Control window in Visual Studio as opposed to adding the solution to source control properly (with binding).  Expression now shows the source control functionality as it should and life is good.  I feel silly for not having realized this from the get go!    

Sunshine

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant

About The Author

I'm a software developer and musician in Edmonton, AB.  I write mostly web-based software, primarily on the Microsoft stack.  I have an MCPD and several MCTS, but I've only been at this whole developer thing for a few years, and the truth is that I'm still learning more than knowing.  So these are my adventures and experiments and some of it will probably be blatantly wrong...  Just warning ya.