You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Taking TFS Offline in Visual Studio to Work Locally With Git and PowerShell

Posted by Keith Elder | Posted in Git, PowerShell, TFS, Visual Studio | Posted on 23-03-2011

Tags: , , ,


I have been using Git (a distributed version control system) more and more lately. At work we are currently using Team Foundation Server (TFS) for our source control. Doing something as simple as checking out a file over the VPN (I work remotely) takes countless minutes out of my day. Even doing something as simple as editing a file takes time.  The seconds add up to minutes and the minutes add up to hours over time. I think I found a work around to using TFS with Git that satifies my needs. Let me know how it works for you.

Here is what I wanted to do:

  1. Use PowerShell with Git to work locally (it is faster)
  2. Put TFS in offline mode and then go online to commit back to TFS, then go back offline

Sounds simple enough but the way TFS works is when you open a solution it tries to connect to TFS. This is the only way to make TFS think you are offline. It almost means you have to disconnect your network cable, load up a solution, wait and let it figure out it is offline. Not optimal.

I got to looking around for a way to just set TFS in offline mode. After much looking around I found nothing, nothing at all. Some more searching I found a VS2010 extension that adds a “Go Offline” option in the File->Source Control menu. Sweet! Here is the link to the extension.


Here is how it looks after installed.


Clicking this takes the solution offline. What does this mean? It means when I need to move a file around or change a file, or edit a file things are instant locally (the way they should be).

Locally I’m using Git to do my check ins, branching, etc. Once I’m done I take the soluction back online by connecting to TFS and then commit the changes back to TFS (or shelve them if I need to share with a team member). I’m currently using PowerShell with GIT and some PowerShell prompt coolness with Git too.  To do this I’m using posh-git (PowerShell environment for Git). Here’s a sample screen shot (and yes the Git branches are in the prompt along with some stats!).


You’ll see the word “Sonic” in blue text. That is the current branch I’m on. The numbers in the prompt are how many files are added, modified or deleted since the last commit. Easy quick and elegant. I’m digging it.

I haven’t been using this very long so I *may* run into some weird situations, if I do I’ll update this post. Let me know what you think if you’ve been using Git with TFS and pass along any tips! Happy coding.

Deep Fried Bytes Episode #57: Getting the Details on Recent Silverlight 4 Updates from John Papa

Posted by Keith Elder | Posted in Podcast, RIA Services, Silverlight, Visual Studio | Posted on 15-02-2011

Tags: , , ,




In this episode Woody sat down shortly after Silverlight 4 was updated in May 2010 with John Papa. The keys to this update was to get both the WCF RIA Services v1.0 and the Silverlight 4 Tools for Visual Studio 2010 officially released and into developers hands. Woody and John discussed these updates and also how developers can learn more about designing and developing great RIA applications with Silverlight 4.

TechEd 2010 .NET From Scratch Slides

Posted by Keith Elder | Posted in .Net, Asp.Net, C#, Mobile Devices, Presentations, Smart Clients, Speaking, SQL Server, TechEd, Visual Studio, WCF, Web Services | Posted on 18-06-2010


TechEd 2010 was in New Orleans last week and I had the pleasure of doing a full day pre-conf session at TechEd.  Pre-confs are longer sessions where attendees can get into more details.  This year I did “.NET From Scratch” which was a one day session to introduce developers to the .NET platform. 

This seminar is for anyone who is starting at ground zero with .NET and wants a deep dive into the platform starting from scratch. It is designed for developers experienced in at least one other language, and starts with the basics of . NET and covers Microsoft Visual Studio, writing code in C#, and how to build applications in various technologies of the platform such as Windows, Web, Microsoft Silverlight, and Windows Mobile. If you are new to writing applications on Microsoft .NET, what better way to start your Tech·Ed experience?

As promised to the attendees, the slide decks and demos can be downloaded from the following URL:


Remember when learning a new platform as large as .NET the main thing to focus on are your immediate needs.  That may be a language and a framework and possibly web programming.  It is impossible to learn or know everything about a platform as large as .NET but knowing what is possible is half of the battle.  As engineers if we know it is possible it is just a matter of research to figure out how to make it happen. 

A big thank you to those that attended the session and I am truly sorry about how cold it was in the room.  If I’d known in advance I’d brought some firewood and blankets.  Enjoy.

My Visual Studio Color Settings

Posted by Keith Elder | Posted in Visual Studio | Posted on 05-03-2010


Several people asked me today what settings I use for Visual Studio after I twittered the following earlier today:


Here’s what my environment looks like.  I use a dark theme.  I can’t tell you how important this was for me after I had eye surgery.  Still is, I can’t stand a lot of glare.


And here is a web.config file view. Very simple color scheme.


If you’d like to try this theme out then download the file below.  Within Visual Studio go to Tools->Import and Export Settings to import.  The changes will be immediate.  Let me know what you think.

UPDATE 3/6/2010

Shawn Wildermuth pointed out that my colors for editing XAML files was horrible.  I don’t edit XAML much and when I opened a XAML file it was as if I was viewing a color scheme designed a 2nd grader.  He was right.  Shawn took my file and updated it and now it is much better. Thanks Shawn!

Thus here is latest version with the XAML fix.


Visual Studio Tutorial – Part 2 – Our First Project

Posted by Keith Elder | Posted in MVP10, Visual Studio | Posted on 21-02-2010


After over 6,600 views on the previous Visual Studio tutorial and multiple comments like “When is part two coming out?” I finally find the time to record and produce part two of this series.  This version is done in HD which provides a much better experience for those watching.  Be sure if you watch you watch from the YouTube website in full screen in HD.

Part two walks through how to create one’s first project and runs the project using the debugger.