VSS to TFS Issue - visual-sourcesafe

I just moved a web app project from VSS to TFS and when I open the solution I get this message everytime.
The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?
Anyone knows how to fix this?

File menu/Source Control/(Advanced)/Change Source Control, then select all your project and "Unbind Them". After that you can try to bind them to TFS in the very same dialog ("Bind" command button).

Related

VS2017 15.7.5 doesn't automatically check out files

I've recently noticed that when I go to make a change which needs a file to be changed, VS2017 (Professional) has started to produce a popup saying:
The file <filename>, which you attempted to edit, is read-only on disk.
Would you like to make the file writeable or edit it anyway?
If I cancel this, I get a message:
The file '<filename>' needs to be checked out before it can be edited.
The file was not checked out automatically because you have disabled automatic checkout
when files are edited in the Source Control options page.
The Source_Control->Plug-in_Selection is set to Visual Studio Team Foundation Server; I haven't changed the Options under Source_Control->Environment; both Saving and Editing are set to Check out automatically.
As far as I know, apart from recently updating from 15.7.4 to 15.7.5, I haven't changed any settings. Is there some setting elsewhere which affects this?
Note, my installation of VS2017 Pro Preview, 15.8.0 preview 5.0, does the same thing and running VS2017 as Administrator does not fix it.
Update:
Visual Studio 2015 has no problem checking out the same files in the same local workspace. That is, if I open a solution in VS2017, edit a file and go to save it, I get the above messages. If I then cancel the edits and try the same thing on the same file in VS2015, the file gets checked out. Hence the problem is with VS2017 and not the files themselves.
OK. After further searching I found a pointer to the answer in this answer. Somehow, my VS2017 instances have gone offline from the TFS server. The menu option File->Source_Control->Advanced->Go_Online sorted things out.
My solution had become unbound from the source control server.
To resolve I used menu options File->Source Control->Advanced->Change source control... Select project or solution without Server Name or Server Binding. Click Bind.

configuring visual studio 2012 & team foundation

I just started working in Visual Studio 2012 in a project group. We are using team foundation server to share our code. I have a couple of problems here I was hoping someone could help me solve them.
I have succesfully connected to our TFS-server and checked out the project, but for some reason when I check my solution explorer it says "0 solutions". I dont know if this is a problem but I feel like it has something to do with my other problems.
I can't, for some reason, press the play button to start debug, also in the menu the debug option is greyed out, 5 obv doesent work either. And in the "project" tab I dont have the option to set my project as startup project wich would make it so that I can debug it.
Check your Source Control Explorer. There you can navigate the code in TFS. Make sure there are files checked in to this location. If not, you will first have to add your project to TFS.
If there are files in TFS, map the files to a location on your harddrive. Then open the solution file by double clicking it in your Solution Explorer.
The MSDN has a nice walktrough: Set Up Team Foundation Server for Version Control
It turns out the local path has to be in the visual studidio\projects folder... re-mapped it and works as intended. No need to answer this anymore, thanks for your suggestions though :)

Is it possible to have Visual Studio update from SVN when I open a solution?

I'm using Visual Studio 2010 with VisualSVN and TortoiseSVN, and would like the option of being prompted to update from source control whenever I open a solution, the way SourceSafe did. Is that possible?
to update from source control whenever I open a solution, the way SourceSafe
I think this update option is not a SourceSafe feature but rather it is the Get everthing when opening a project or solution option found in the Visual Studio source control options panel.
When Visual Studio connects to SourceSafe it does so using the MS-SCCI.
So if you use a MS-SCCI Subversion plugin this should also happen whenever you open a project or solution.
For example the Agent SVN is an MS-SCCI Subversion plugin and it should work this way.
You will have to build an extension for VS which will use the TortoiseSVN automation API ( http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html ) and do the update when you open a solution:
Or modify existing extensions ( integrations) like AnkhSVN to do that.
I don't think it has a way to auto-prompt you, but have you tried the AnkhSVN Visual Studio Subversion Plugin? It allows you to easily update solutions, add to, etc.

How to prevent "There appears to be a discrepancy between the solution's source control..." without changing the .sln file

Note: I saw "There appears to be a discrepancy between the solution's source control ...." , but this doesn't apply, as I wish to fix this without changing the .sln file.
For some reason, any time I open a solution which has in the sln file:
SccTeamFoundationServer = http://servername:8080/tfs/defaultcollection
SccAuxPath* = http://servername:8080/tfs/defaultcollection
My copy of VSS insists on switching it to
SccTeamFoundationServer = http://servername:8080/tfs/
SccAuxPath* = http://servername:8080/tfs/
Saving these changes does fix everything for me, but everyone else using the same version control server is fine with the 1st version but not the second version. I wish for my computer's version control server/paths to be consistent with that of my coworkers.
Everyone is using Visual Studio 2010 with Visual Studio 2010 Team Explorer.
I had this problem with a Solution containing *.vcxproj project files, that were previously migrated from VS2008 to VS2010.
The path to TFS was defined in both the .sln file and the .vcxproj files.
The simplest fix was to update the *.vcxproj project files to use the SAK keyword.
ie update from the format:
<SccProjectName>$/MyProject/Directory/abc</SccProjectName>
<SccAuxPath>http://servername:8080/tfs/defaultcollection</SccAuxPath>
<SccLocalPath>.</SccLocalPath>
<SccProvider>{11111111-1111-1111-1111-111111111111}</SccProvider>
to
<SccProjectName>SAK</SccProjectName>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
<SccProvider>SAK</SccProvider>
Have you tried connecting to http://servername:8080/tfs/defaultcollection instead of http://servername:8080/tfs/ in your Team Explorer settings - Team Project Connection? Try to do that, let someone who have the http://servername:8080/tfs/ version check-in, remap your local instance then get latest.
I just had this exact problem. I finally solved the issue by disconnecting from TFS and reconnecting:
In Team Explorer (View-Team Explorer), right-click on your TFS server name and click 'Disconnect'. Then click Team-Connect to Team Foundation Server...
I did not have any pending changes when I did this. I would check in your code or at least shelve your changes before doing this to decrease the chance of losing work.
The computer that this happened on had been working fine for over a year, but I guess Visual Studio somehow cached the name as http://servername:8080/tfs/ instead of http://servername:8080/tfs/defaultcollection and disconnecting and reconnecting to TFS reset VS to the correct path of http://servername:8080/tfs/defaultcollection. On my server (and I would guess on everyone's) http://servername:8080/tfs/ and http://servername:8080/tfs/defaultcollection point to the same thing. Raymund's solution didn't work for me - I had the same problem that Brian had with it.
Using Visual Studio you can solve this problem by unbinding and binding the solution and/or projects. Try this:
Open the problem solution in VS (did this in VS2013 just now)
Commit anything you need to commit (let's keep it simple - nothing to merge/checkin)
If there are any pending changes then undo all pending changes to all the projects in that solution and any changes to the solution itself
Go to File -> Source Control -> Advanced -> Change Source Control
Select the problem projects and click "Unbind"
Click OK and close the window (THIS IS IMPORTANT - if you don't click OK VS doesn't update the solution properly)
Go to File -> Source Control -> Advanced -> Change Source Control
Select all the projects you unbound in #5 and click "Bind"
Click OK and close the window
Check in your Solution & Project changes
Close the solution and open it back up and everything should be fine now
Also try opening the .sln file from Source Control Explorer, I think that may have been what solved the issue for me.

How to work offline with TFS

Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work!
Is it possible to switch TFS into an offline mode in the event of such an issue?
See this reference for information on how to bind/unbind your solution or project from source control. NOTE: this doesn't apply if you are using GIT and may not apply to versions later than VS2008.
Quoting from the reference:
To disconnect a solution or project
from source control
In Visual Studio, open Solution
Explorer and select the item(s) to
disconnect.
On the File menu, click Source
Control, then Change Source Control.
In the Change Source Control dialog
box, click Disconnect.
Click OK.
The 'Go Offline' extension adds a button to the Source Control menu.
https://visualstudiogallery.msdn.microsoft.com/6e54271c-2c4e-4911-a1b4-a65a588ae138
plundberg: The "disconnect" button is only available for the TFS provider starting in VS 2008. Even then, I'm not sure if it's officially supported. The recommended way to use the Go Offline feature is to [re]open the solution.
Martin Pritchard: if you get stuck mid-operation, you can force VS to timeout by pulling the network plug (literally) or running ipconfig /release.
Once you're marked offline, here's a step by step guide to working in that mode: http://teamfoundation.blogspot.com/2007/12/offline-and-back-again-in-vs2008.html
More detailed info on tweaking the behind-the-scenes behavior:
http://blogs.msdn.com/benryan/archive/2007/12/12/when-and-how-does-my-solution-go-offline.aspx
http://blogs.msdn.com/benryan/archive/2007/12/12/how-to-make-tfs-offline-strictly-solution-based.aspx
There are couple of little visual studio extensions for this purpose:
For VS2010 & TFS 2010, try this
For VS2012 & TFS 2010, use this
In case of TFS 2012, looks like there is no need for 'Go offline' extensions. I read something about a new feature called local workspace for the similar purpose.
Alternatively I had good success with Git-TF. All the goodness of git and when you are ready, you can push it to TFS.
Depending on which tool windows you have open, VS may or may not try to hit the team server automatically when it starts up.
For best results try this:
Close all instances of visual studio
Open an empty visual studio (no project/solution)
See which windows are opened by default, if source control explorer or team explorer or any other windows that use team are opened (and activated) by default, close them or switch them to a background tab.
Close visual studio
You should notice now that you can start visual studio without it trying to hit the TFS server.
I know its just an aside to your problem, but I hope you find this helpful!
If you have a solution open, and TFS is down, you might have trouble going into offline mode. If you close and reopen your solution, a nice little dialog will appear asking you if you want to Go Offline.
Alternatively if you don't want to close/reopen the solution, (as suggested by Bernie) you can install the TFS Go-Offline plugin, then click:
TEAM -> Go Offline
Simply, change the root folder name for your solution in your local machine, it will disconnect automatically.
I just wanted to include a link to a resolution to an issue I was having with VS2008 and TFS08.
I accidently opened my solution without being connected to my network and was not able to get it "back the way it was" and had to rebind every time I openned.
I found the solution here;
http://www.fkollmann.de/v2/post/Visual-Studio-2008-refuses-to-bind-to-TFS-or-to-open-solution-source-controlled.aspx
Basically, you need to open the "Connect to Team Foundation Server" and then "Servers..." once there, Delete/Remove your server and re-add it. This fixed my issue.
If the code has already been checked out by the user that if offline and they have the latest version on their local hd, then they just need to browse to the solution location and open the solution by double clicking sln file. The solution will open in disconnected mode.

Resources