ChatGPT解决这个技术问题 Extra ChatGPT

How do I get my solution in Visual Studio back online in TFS?

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?


A
Appulus

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.


Worked for me, thanks a lot. It would be weird to get into the registry for this.
I really needed this today. Thanks for providing an answer. Worked great.
Worked for me, but the programsurfer link is broken.
Why doesn't this show up first. I almost missed this answer. :(
This is the best answer and also works in Visual Studio 2017. No need to edit the registry.
H
Hadagalberto Junior

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


A
Appulus

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).


A
Ariella

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

For Visual Studio 2015, Version 14

Turn off all VS instances 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") Set both the Offline and AutoReconnect values to 0. 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. Again, make sure both values are set to zero. Restart your solution

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


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.
c
chety

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:

Tried to regedit option but can not see appropriate menu options. Didn't work. 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.


u
user3683748

You can go use registry editor.

Turn off all VS instances. Open registry editor and go to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances Find proper server e.g: team32system1 Go to Collection and nex DefaultCollection: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\Instances\team32system1\Collections\DefaultCollection Set Offline key to 0 Open solution in VS. Afterwards pop up should appear which question would you like bring solution to online mode.


stackoverflow.com/questions/261525/… I preffer the following page than that solution ;). Good to rebind all the csproj
S
Saad

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.


J
Jay Magwadiya

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


A
Abhijit Vyas

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


J
J. Zacka

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