Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ItemNotMappedException: There is no working folder mapping for XYZ

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.

This is my workspace definition

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.

like image 976
Peter Bucher Avatar asked Aug 18 '14 16:08

Peter Bucher


1 Answers

I found the solution. You have to call "Workstation.Current.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

like image 178
Peter Bucher Avatar answered Oct 04 '22 20:10

Peter Bucher