Hi, I'm trying to change a current working folder but I'm getting an error because it says that workingfolder.LocalItem is readonly. How do I change an existing folder mapping
The "brute force" mechanism is to use the Update() method on the Workspace instance - you'll construct a new array of WorkingFolder items. In your case, it would be the existing array, remove the one you want to modify, and add in a new WorkingFolder(serverpath, localpath). This is more useful for cases where you're modifying multiple mappings and want to do so with a single server call.
Change working folder programatically
eddy05
Andrew Niemann
You can try the workspace.Map() call first - that's the easiest path.
http://msdn2.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.workspace.map(VS.80).aspx
The "brute force" mechanism is to use the Update() method on the Workspace instance - you'll construct a new array of WorkingFolder items. In your case, it would be the existing array, remove the one you want to modify, and add in a new WorkingFolder(serverpath, localpath). This is more useful for cases where you're modifying multiple mappings and want to do so with a single server call.
http://msdn2.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.workspace.update(VS.80).aspx