ItemNotMappedException: There is no working folder mapping for XYZ

回眸只為那壹抹淺笑 提交于 2019-12-22 08:52:46

问题


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

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

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

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

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.


回答1:


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

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

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



来源:https://stackoverflow.com/questions/25367922/itemnotmappedexception-there-is-no-working-folder-mapping-for-xyz

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!