How to unset working folder via API?

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Tilman
Posts: 52
Joined: Thu Mar 08, 2007 3:49 am

How to unset working folder via API?

Post by Tilman » Wed Sep 19, 2007 7:06 am

Hi,

How can one unset a working folder via the API (v3.5.2)? The documentation doesn't seem to mention this.

In a previous post (for v2.0) i this was suggested:

Code: Select all

m_VaultClient.TreeCache.SetWorkingFolder(versionFolder.FullPath, null);
However, that gives the following exception:

System.ArgumentNullException occurred
Message="Null disk path is invalid when setting working folder.\r\nParameter name: diskPath"
Source="VaultClientOperationsLib"
ParamName="diskPath"
StackTrace:
at VaultClientOperationsLib.TreeCache.SetWorkingFolder(String fullPath, String diskPath, Boolean forceSubfoldersToInherit, Boolean fromShadowFolders)
at VaultClientOperationsLib.TreeCache.SetWorkingFolder(String fullPath, String diskPath)
at RedGate.MSBuild.Tasks.UpdateVault.unSetWorkingFolder(VaultClientFolder versionFolder) in D:\Work\MSBuildTasks\MSBuildTasks\UpdateVault.cs:line 226

Setting the working folder to the empty string is no good, either, as only one folder can have that working folder.

So, how do you do it?

Thanks,

Tilman

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Sep 19, 2007 8:37 am

Look at TreeCache::RemoveWorkingFolder().
Jeff Clausius
SourceGear

Tilman
Posts: 52
Joined: Thu Mar 08, 2007 3:49 am

Post by Tilman » Mon Oct 29, 2007 8:45 am

Thanks, that did the trick!

Locked