255

I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prompt to ask whether I wanted to Overwrite the file saying the TFS server was down (can't remember the exact words) and the following message appeared in the Output window:

This solution is offline.  [Team Foundation Server: http://tfs1:8080/tfs/server]
The solution was offline during its previous session and will remain offline.

How do I get the file change to be recognised as being among Pending Changes and the whole solution back online?

Appulus
  • 18,630
  • 11
  • 38
  • 46

11 Answers11

537

I searched for the solution online and found this solution but wasn't too keen on the registry change.

I found a better way: right-click on the solution name right at the top of the Solution Explorer and select the Go Online option. Clicking this allowed me to select the files that had been changed when I was offline and make the solution online again.

After finding the solution, I found the following msdn forum thread which confirmed the above.

Appulus
  • 18,630
  • 11
  • 38
  • 46
  • Thanks @LordScree and @DavidGardiner; have updated the registry change (ProgramSurfer) link to one that still works (which was actually another one I came across at the time). – Appulus Jul 11 '13 at 11:35
  • There was no option to go online when I clicked on the project name. However, clicking on _My Project_ had that option. – Daniel Jan 28 '15 at 14:03
  • I was having this issue too, but did not see the option to _Go Online_. I found this [msdn article](https://msdn.microsoft.com/en-us/library/bb166812.aspx) article which explains how to "establish or reestablish a source control link between a solution/project and the version store". – jhenninger Mar 24 '15 at 16:31
  • Go Online didn't work for me (that's the first thing I tried) - I had to edit registry as per http://nurhak-kaya.blogspot.de/2012/10/solution-for-visual-studio-2012-tfs.html – Bartosz Mar 16 '16 at 08:22
  • There was no option to go online when I clicked on the project name. A RESTART of Visual Studio helped in my case. – Beauty Oct 13 '16 at 12:59
  • 4
    This is the best answer and also works in Visual Studio 2017. No need to edit the registry. – W. Young Dec 14 '17 at 16:26
  • Worked for me in VS2013 –  Jan 09 '19 at 15:17
10

Go to File > Source Control > Go Online, select the files you changed, and finish the process.

9

Rename the solution's corresponding .SUO file. The SUO file contains the TFS status (online/offline), amongst a host of other goodies.

Do this only if the "right-click on the solution name right at the top of the Solution Explorer and select the Go Online option" fails (because e.g. you installed VS2015 preview).

Appulus
  • 18,630
  • 11
  • 38
  • 46
7

(Additional step from solution above for if you are missing the AutoReconnect or Offline registry value)

For Visual Studio 2015, Version 14

  1. Turn off all VS instances
  2. HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\TeamFoundation\Instances{YourServerName}\Collections{TheCollectionName} (To get to this directory on Windows, hit the Windows + R key and search for "regedit")
  3. Set both the Offline and AutoReconnect values to 0.
  4. If you are missing one of those attributes (in my case I was missing AutoReconnect), right click and and create a new DWORD(32-bit) value with the desired missing name, AutoReconnect or Offline.
  5. Again, make sure both values are set to zero.
  6. Restart your solution

Additional info: blog MSDN - When and how does my solution go offline?

digiwand
  • 1,258
  • 1
  • 12
  • 18
  • I use your solution but the problem persists. To resolve it, I go to : - Explorer (Windows Logo + E), - Looking for my TFS folder - Right Click on the Folder with Status : Inactive (to understand it have a look at File -> Source Control -> Advanced -> Change Source Control into VS 2019) - Team Foundation Server -> Add Back at VS 2019: - Unbind your Solution/Project and bind it again. Finish. – Dôn Kayt Sep 17 '20 at 13:47
4

I am using Visual Studio 2017 15.4.0 version. Especially when i started use lightweight solution option, this offline thing happened to me. I tried to above solutions which are:

  1. Tried to regedit option but can not see appropriate menu options. Didn't work.
  2. Right click on solution, there is go online option and when i choose it that gives this error message: "The solution is offline because its associated Team Foundation Server is offline. Unable to determine the workspace for this solution."

Then from File -> Source Control -> Advanced -> Change Source Control. I saw my files. I select them and then chose bind option. That worked for me.

chety
  • 136
  • 4
2

You can go use registry editor.

  1. Turn off all VS instances.
  2. Open registry editor and go to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances
  3. Find proper server e.g: team32system1
  4. Go to Collection and nex DefaultCollection: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances\team32system1\Collections\DefaultCollection
  5. Set Offline key to 0
  6. Open solution in VS. Afterwards pop up should appear which question would you like bring solution to online mode.
  • http://stackoverflow.com/questions/261525/how-does-visual-studios-source-control-integration-work-with-perforce I preffer the following page than that solution ;). Good to rebind all the csproj – Nordes Aug 11 '14 at 07:50
1

Neither of the above solutions worked for me on Visual Studio Community 2017 v15.7.1. Somehow, there was no "Go Online" option in the context menu. I tried registry edit as suggested here, but that only displayed me error that it could not find the binding. What worked for me is rebinding solution to the server from Change Source Control menu.

Go to File->Source Control->Advanced->Change Source Control and make sure that your solution is binded to your source control. If not (like mine) then click on bind button, it will automatically search online TFS server and rebind your solution to it.

Saad
  • 198
  • 2
  • 12
0

i found another way without much effort.

Just simply right click your solution and then click undo pending changes.

Next, VS will ask you for acutally changed file where you want to undo or not specific file.

In this you can click no for such a file where actual change is happende, rest is just undoing. This will not lost your actual changes

Jay Magwadiya
  • 410
  • 2
  • 6
  • 14
0

You will need to do two steps here for a complete solution

First click on the Solution that you have open and then go File-> Source Control -> Go Online Then uncheck all the files that are being shown as being modified while you were offline.

Don't do the Get Latest version from Source Control Explorer. That will result in a dialog potentially showing a bunch of files asking you to resolve conflicts. Instead do this

In source Control explorer right click on the folder you want to get latest of and then Advanced - Get Specific Version. In the dropdown for version type choose Latest and then choose the first check box that says Overwrite writable files that are not checked out. This will automatically bring your folder in sync with latest on the server

0

One method I did with mine, is to "Add to Source Control", and select 'Git'.

J. Zacka
  • 139
  • 2
  • 2
  • 12
0

My issue was really simple. Just a sign in issue, my password had changed and I had to re-log in to the Teams server. After that, refreshing the server, all is well and normal.

catcoder
  • 15
  • 8