本文介绍了ItemNotMappedException:XYZ 没有工作文件夹映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 VersionControlOnNonFatalError-Eventhandler 得到一个异常,内容如下:

I get a Exception throught VersionControlOnNonFatalError-Eventhandler with the following Content:

C:\SqlWorkspace 没有工作文件夹映射."

"There is no working folder mapping for C:\SqlWorkspace."

我的机器上确实有那个映射.因此,我想知道有什么问题.

I have indeed that mapping on my machine. Because of this, i wonder whats wrong.

错误是在workspace.PendAdd(pc.LocalItem);"这一行引发的其中 pc.LocalItem 包含C:\SqlWorkspace\Audits.sql"

The error is provoked on the line "workspace.PendAdd(pc.LocalItem);" where pc.LocalItem contains "C:\SqlWorkspace\Audits.sql"

Workspace.Folders 包含:LocalItem: "C:\SqlWorkspace ServerItem: $/Code/y_Test/SqlHistoryNew Type: Map}"

Workspace.Folders contains: LocalItem: "C:\SqlWorkspace ServerItem: $/Code/y_Test/SqlHistoryNew Type: Map}"

为什么会出现这个错误,所有的设置和参数好像都没问题?像我这样的其他问题没有给我任何提示,这可能很有用.

Why this error, all settings and parameters seems to be ok?Other questions like mine gave me no hints, which could have been useful.

推荐答案

我找到了解决方案.您必须调用Workstation.Current.EnsureUpdateWorkspaceInfoCache()";在任何 PendAdd/PendDelete/... 调用之前.

I found the solution. You have to call "Workstation.Current.EnsureUpdateWorkspaceInfoCache()" before any PendAdd / PendDelete / ... call.

结果是:没有错误,因此 GetPendingChanges() 包含您提升的文件.

The result is: No error and therefore GetPendingChanges() contains your promoted files.

我在这个网站上找到了解决方案:http://social.msdn.microsoft.com/Forums/vstudio/en-US/96a8e35d-1f84-4ac3-8767-e3682dd75e1a/problem-with-pendadd?forum=tfsversioncontrol

I found the solution on this site: http://social.msdn.microsoft.com/Forums/vstudio/en-US/96a8e35d-1f84-4ac3-8767-e3682dd75e1a/problem-with-pendadd?forum=tfsversioncontrol

这篇关于ItemNotMappedException:XYZ 没有工作文件夹映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 04:49