Tip of the day: Getting Visual Studio with TFS to work offline

Earlier to day our TFS server went down. Visual Studio likes to have a constant connection open to it, but obviously that wasn’t going to happen. Luckily, it is possible to work on a solution with no connection to TFS.

If you were just starting some work…

If Visual Studio was open when TFS went off-line then it won’t allow you to check out any files. If all your files are checked in already, then you can just shut down Visual Studio and then start again. When the solution opens it detects that TFS is gone and offers to open the project in Offline mode:

Go Offline

TFS Go Offline

When TFS is available again you can simply reconnect to the server by selecting the Team?Connect to Team Foundation Server… menu. Once you are connected, you can right-click the solution and select “Go Online“.

You’ll get a dialog that asks to to confirm the files that you’ve changed in the meantime:

Go Online

TFS Go Online

It will then take a few moments for TFS to catch up (I have quite a large solution, so it took about a minute for me) then the files appeared in the Pending Changes window ready to be checked in as normal.

If you were in the middle of something

If you already had files checked out when TFS went offline then this post about converting to offline may be more useful to you.

There is also a Visual Studio extension, if you prefer not having to restart Visual Studio called Go Offline. Once installed, just to to File?Source Control?Go Offline. This may be a more useful solution if you are constantly going in and out of connection with TFS (a mobile broadband connection on a train for example).

About Colin Angus Mackay
I blog at ColinMackay.co.uk. I help run Scottish Developers which is a user group for software developers in Scotland, and co-organise the DDD Scotland conferences.

3 Responses to Tip of the day: Getting Visual Studio with TFS to work offline

  1. Vladimir says:

    Wow…Such a non-informative article is rare to be seen. It has no relevance to the title at all, and no useful information besides the link to an extension. Bad job mate, please fix it.

    • I can’t please everyone. If you didn’t get useful information from my blog then feel free to move along to the next site. I write mostly as an aide-mémoire to myself. If it helps others then that’s great, if not then… C’est la vie.

    • Mikael Johansson says:

      What an ass you are Vladimir. If you dont need the information or like it just dont read it.

      It did help me at least. Thanks for a great article Colin!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: