为什么我的TFS工作空间路径会自行重新映射?

时间:2023-01-24 13:51:38

We're using Visual Studio 2008/TFS 2008.

我们正在使用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. 工作空间定义存储在哪里?

  3. Is there something we may have checked into TFS that's causing this?
  4. 我们可能已经检查过TFS导致了什么吗?

5 个解决方案

#1


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.

我在打开解决方案的时候遇到了这种情况。如果解决方案包含不在其文件夹下的其他项目的相对路径,在工作区中以不同方式映射,GET将告诉我它正在重新映射以解释它。问题是它做出的决定是完全错误的。

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.

唯一的方法是确保所有开发人员使用sourcec控件使用的相同结构,并在每个工作区中使用hasv。

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.

到达那里是一个痛苦。基本上每个人都必须删除所有文件的所有本地副本,重做工作区,选择在工作空间更改时“获取”,关闭VS,打开,获取最新信息。

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

原因是如果项目的副本在当地存在,即使这些项目没有开放,GET仍然是错误的。这很令人沮丧,因为在检查那些项目与最新项目的差异时没有任何变化,但是当打开包含该项目的解决方案时,该项目中的dll引用将自动更改。此时,任何文件都没有待处理的更改。但是在构建之后,这些变化将会持续下去并导致下一次变更...

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

我确定这一切都错了,但这就是我们本周发生的事情。

#2


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)

这不是正常的行为 - 听起来像是有趣的事情。只是想检查一下 - 你所做的一切都是简单的从源代码管理资源管理器获取正确吗?还 - 你们所有人都在不同的机器上? (即,您没有共享虚拟PC映像或多台机器具有相同名称的任何内容)

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.

有人认为我要检查的是转到文件,源代码控制,管理工作区并查看get之前和之后的工作文件夹映射,看看是否有任何变化。它不应该 - 如果它这样做可能会给我们一个关于发生了什么的线索。

#3


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

#4


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

首先安装Visual Studio 2008 SP1。(我想你已经安装了VS 2008和Team Explorer)。

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.

现在启动Visual Studio 2008,转到源代码控制并删除工作区。创建一个新工作区并将源控件文件夹设置为本地文件夹映射。单击确定。当它询问“工作区已被修改,您想要获得最新”时,请选择否。

Now Close Visual Studio 2008.

现在关闭Visual Studio 2008。

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

重新打开Visual Studio 2008并转到源代码控制和“获取特定”(选中两个复选框以覆盖文件)。

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!

如果你有一个基于asp.net web的解决方案,现在是时候创建应用程序池,在IIS中配置网站,设置适当的身份验证和授权。否则它是可选的!

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.

执行上述步骤,如果您的网站已配置,Visual Studio 2008将自动检测您已设置的网站并提示您进行确认。点击确定。

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.

真正的问题是Visual Studio 2008 Service Pack 1.没有它,TFS映射就会被破坏。如果安装了IF SP1并遵循了上述指南,则没有问题。

#5


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.

如果转到命令行并键入“tf workspace”,您将看到工作区的定义。

#1


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.

我在打开解决方案的时候遇到了这种情况。如果解决方案包含不在其文件夹下的其他项目的相对路径,在工作区中以不同方式映射,GET将告诉我它正在重新映射以解释它。问题是它做出的决定是完全错误的。

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.

唯一的方法是确保所有开发人员使用sourcec控件使用的相同结构,并在每个工作区中使用hasv。

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.

到达那里是一个痛苦。基本上每个人都必须删除所有文件的所有本地副本,重做工作区,选择在工作空间更改时“获取”,关闭VS,打开,获取最新信息。

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

原因是如果项目的副本在当地存在,即使这些项目没有开放,GET仍然是错误的。这很令人沮丧,因为在检查那些项目与最新项目的差异时没有任何变化,但是当打开包含该项目的解决方案时,该项目中的dll引用将自动更改。此时,任何文件都没有待处理的更改。但是在构建之后,这些变化将会持续下去并导致下一次变更...

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

我确定这一切都错了,但这就是我们本周发生的事情。

#2


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)

这不是正常的行为 - 听起来像是有趣的事情。只是想检查一下 - 你所做的一切都是简单的从源代码管理资源管理器获取正确吗?还 - 你们所有人都在不同的机器上? (即,您没有共享虚拟PC映像或多台机器具有相同名称的任何内容)

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.

有人认为我要检查的是转到文件,源代码控制,管理工作区并查看get之前和之后的工作文件夹映射,看看是否有任何变化。它不应该 - 如果它这样做可能会给我们一个关于发生了什么的线索。

#3


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

#4


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

首先安装Visual Studio 2008 SP1。(我想你已经安装了VS 2008和Team Explorer)。

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.

现在启动Visual Studio 2008,转到源代码控制并删除工作区。创建一个新工作区并将源控件文件夹设置为本地文件夹映射。单击确定。当它询问“工作区已被修改,您想要获得最新”时,请选择否。

Now Close Visual Studio 2008.

现在关闭Visual Studio 2008。

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

重新打开Visual Studio 2008并转到源代码控制和“获取特定”(选中两个复选框以覆盖文件)。

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!

如果你有一个基于asp.net web的解决方案,现在是时候创建应用程序池,在IIS中配置网站,设置适当的身份验证和授权。否则它是可选的!

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.

执行上述步骤,如果您的网站已配置,Visual Studio 2008将自动检测您已设置的网站并提示您进行确认。点击确定。

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.

真正的问题是Visual Studio 2008 Service Pack 1.没有它,TFS映射就会被破坏。如果安装了IF SP1并遵循了上述指南,则没有问题。

#5


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.

如果转到命令行并键入“tf workspace”,您将看到工作区的定义。