SkunkSpinner
SkunkSpinner

Reputation: 11646

Why does my TFS workspace path keep remapping itself?

We're using Visual Studio 2008/TFS 2008.

We have a small team of developers and for some reason, periodically, when any of us "Get Latest," one of our paths remaps to a different path on it's own. This causes the "Get Latest" to start deleting files, because the path has changed. It's the same path every time that gets remapped to the wrong path.

  1. Where are workspace definitions stored?
  2. Is there something we may have checked into TFS that's causing this?

Upvotes: 6

Views: 6465

Answers (5)

Steve Johnson
Steve Johnson

Reputation: 3114

Ok i got it. Here is the solution.

First of all install Visual Studio 2008 SP1.(i suppose you have VS 2008 and Team Explorer already installed).

Now launch Visual Studio 2008, Goto Source Control and delete workspace. Create a new workspace and make a source control folder to local folder mapping. Click Ok. When it asks "Workspace has been modified, you you want to get latest", Select NO.

Now Close Visual Studio 2008.

Reopen Visual Studio 2008 and go to source control and Get Specific (with both check boxes checked for overwriting files).

If you have a asp.net web based solution, now is the time to create application pool, configure website in IIS, set proper authentication and authorization. Otherwise its optional!

Now goto the appropriate folder in source control and double click the solution file. You may also open the solution by double clicking the solution file in your local folder but i find it easier to open the solution from source control.

Doing the above step, if your website is configured, Visual Studio 2008 will automatically detect your website that you had setup and prompt you to confirm it. Click ok.

It will contact the source control server to see if synchronization is necessary or not. If you have a number of projects in your solution, you will observe the file-get progress bar quickly blink across your screen and your solution will be setup in minutes.

The real problem is of Visual Studio 2008 Service Pack 1. Without which TFS mapping gets corrupted. IF SP1 is installed and the above guide is followed there will be no problem.

Upvotes: 1

etropic
etropic

Reputation:

I have had this happen when I get while opening a solution. If the solution contains relative paths to other projects not under it's folder, that are mapped differently in your workspace, the GET will tell me it's remapping to account for it. Problem is the decisions that it makes are completely wrong.

The only way around it was to ensure that all developers use the same structure that sourcec control uses and havev that represented in each workspace.

Getting there was a pain though. basicly everyone had to delete all local copies of all files, redo workspace, CHOOSE NO TO 'GET' WHEN WORKSPACE CHANGED, close VS, open, GET LATEST.

The reason for that was if copies of projects exsisted local, even if those projects were NOT open, the GET would still be wrong. This was frustrating, because when checking for differences in those projects with latest there was no change, but when opening the solution that contained that project, dll references in that project would auto change. At that moment, no changes are pending on ANY file. But after building the changes would persist and cause the next get to be off again...

I'm sure this is all wrong, but that's what happened to us this week.

Upvotes: 6

Christopher Klein
Christopher Klein

Reputation: 2793

You can also try clearing your workspace cache and remap it:

SET AppDataTF=%USERPROFILE%\Local Settings\Application Data\Microsoft\Team Foundation
SET AppDataVS=%APPDATA%\Microsoft\VisualStudio
IF EXIST "%AppDataTF%\1.0\Cache" rd /s /q "%AppDataTF%\1.0\Cache" > NUL
IF EXIST "%AppDataTF%\2.0\Cache" rd /s /q "%AppDataTF%\2.0\Cache" > NUL
IF EXIST "%AppDataVS%\8.0\Team Explorer" rd /s /q "%AppDataVS%\8.0\Team Explorer" > NUL
IF EXIST "%AppDataVS%\9.0\Team Explorer" rd /s /q "%AppDataVS%\9.0\Team Explorer" > NUL

Upvotes: 1

Martin Woodward
Martin Woodward

Reputation: 11770

This is not normal behavior - sounds like something is going funny. Just wanted to check - all you are doing is simple get's from Source Control explorer correct? Also - all of you are on different machines? (I.e. you are not sharing a virtual PC image or anything where multiple machines have the same name)

One think I would check is to go to File, Source Control, Manage Workspaces and look at your working folder mappings both before and after the get and see if anything is changing. It shouldn't - if it does this might give us a clue as to what is happening.

Upvotes: 1

Remi Lemarchand
Remi Lemarchand

Reputation:

The Workspace definitions are stored on the server.

If you go to the command line and type "tf workspace", you will see the definition of your workspace.

Upvotes: 0

Related Questions