Page 2 of 2

Posted: Wed Apr 30, 2008 11:57 am
by random
both fullPaths and diskPaths contain 0 items.

Posted: Wed Apr 30, 2008 11:59 am
by shannon
Somehow you aren't connecting to the gui client and within your code as the same user. Working folders are stored per user and per machine.

Posted: Wed Apr 30, 2008 12:04 pm
by random
How would I go about determining if this is the case? I do not think that I am connecting to my client but rather the server, which probably explains why I am not getting a working folder. This is the code that I use to login, where path is the path to our vault server. I believe I am using the same credentials, but I will double check.

public static bool Login( string path, string repository, string username, string password )
{
if( m_isConnected )
return true;

try
{
m_client = new ClientInstance();
m_client.Init(VaultClientNetLib.VaultConnection.AccessLevelType.Client );

if( !string.IsNullOrEmpty( path ) )
m_path = path;

if( !string.IsNullOrEmpty( repository ) )
m_repository = repository;

if( string.IsNullOrEmpty( username ) || string.IsNullOrEmpty( password ) )
throw new ArgumentNullException( "username or password is null or empty" );

m_client.Login( m_path, username, password );

// set the active repository
VaultLib.VaultRepositoryInfo[] repositories = null;
m_client.ListRepositories( ref repositories );

foreach( VaultLib.VaultRepositoryInfo repositoryInfo in repositories )
{
if( repositoryInfo.RepName.ToUpper() == m_repository.ToUpper() )
{
m_client.SetActiveRepositoryID( repositoryInfo.RepID, username, repositoryInfo.RepName, true, false );
break;
}
}

m_path = path;
m_repository = repository;
m_isConnected = true;
return true;
}
catch
{
}

return false;

Posted: Wed Apr 30, 2008 12:14 pm
by random
I have confirmed that I am using the same username and password in both the GUI client and API calls.

Posted: Wed Apr 30, 2008 12:23 pm
by shannon
try setting the working folder from your code before listing the working folder assignments.

Posted: Wed Apr 30, 2008 1:19 pm
by random
Setting the working folder through code does work; however, I was hoping that I could use the working folders defined in Vault GUI client.

Is there a possible workaround?

Posted: Wed Apr 30, 2008 2:49 pm
by shannon
Compare the value of ClientInstance.LocalStoreBasePath with the value the gui client is using for the cache location (Options->Local Files->Cache Location). If your app is running as a different windows user, these paths will be different.

Posted: Thu May 01, 2008 8:19 am
by random
The paths are the same.

Posted: Thu May 01, 2008 8:47 am
by shannon
Is the code for this app running on a different machine than the gui client you are using?

Posted: Thu May 01, 2008 8:48 am
by random
Both the GUI client and the application that uses the API are running on the same machine.

Posted: Thu May 01, 2008 10:04 am
by shannon
Can you give me a screenshot of the Cache location page of the options dialog from your gui client please?

Posted: Thu May 01, 2008 10:26 am
by random
From the API call:

m_client.LocalStoreBasePath
"D:\\Program Files\\SourceGear\\Vault_1\\Client"

GUI Client options

Image

Posted: Thu May 01, 2008 2:02 pm
by shannon
I don't think I can figure this out without more detailed information about your application and setup. Please email support at sourcegear.com ATTN: shannon with a link to this thread and your phone number.

Posted: Fri May 02, 2008 6:52 am
by random
I have sent you an email with a repro application. Thank you for assistance, it is greatly appreciated.