Settings.xml Local Settings Path

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear


Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Fri Jan 24, 2014 9:20 am
We have moved our VP server from 6.1 on Win2k3 to 7.1 on Win2k8.

Our code which uses Mantis* is being tested.

Error which I believe comes from ProcessCommandListFortressProjects is:

Couldn't calculate a local settings path for settings.xml. Tried both "" and "SourceGear".

Any suggested actions / tips?

VP is working fine otherwise - web and windows clients. Just not via our API client code from 6.x.

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Fri Jan 24, 2014 11:15 am
Make sure the machine is setup with ASP.NET, the client API Dlls are in the same directory as your own web service if that's what you are setting, and that the LocalSettings.Init()'s second parameter is a path to a location where the web service can write the settings.xml file.

If you're using UtilityService.AppSettings, what s the value of "UtilityService.AppSettings["VaultSettingsXMLFileLocation"]"?

Does Vault have full rights to that location?
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Mon Jan 27, 2014 5:58 am
Yes - asp.net is installed and VP works fine via windows or web client.

Sorry but - I can't find any reference to UtilityService or 'VaultSettingsXMLFileLocation' in our code.

I think perhaps our code is quite a few years old and there may be some new options in the API.

The client API DLL's are in a subfolder in the site called 'bin'.

I downloaded the VaultIntegrationLib.chm help file but can't find a reference to this 'UtilityService' either?

Is this set before the login method is called?

Here is our login code:


ServerOperations.client.LoginOptions.URL = sFORTRESS_URL;
ServerOperations.client.LoginOptions.User = sUSER;
ServerOperations.client.LoginOptions.Password = sPWD;
ServerOperations.Login();
objProjects = ItemTrackingOperations.ProcessCommandListFortressProjects();

Please can you let me know about the UtilityService as it's not something we have used before.

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Mon Jan 27, 2014 5:58 am
Forgot to say - we never call this: LocalSettings.Init()

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Mon Jan 27, 2014 11:34 am
You need LocalSettings.Init(LocalSettingsScope scope, string strDefaultConfigDir)
with a valid Default Config Directory.
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Mon Jan 27, 2014 12:32 pm
....OK thanks for getting back to me.

Which namespace is LocalSettings part of? I can't find it in the API documentation - sorry.

And, can this directory be UNC or a drive letter?

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Mon Jan 27, 2014 3:45 pm
VaultClientOperationsLib.LocalSettings()


Are you running Vault under a user or as a service?

If it is running as a service, then a network drive probably won't work.
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Tue Jan 28, 2014 3:14 am
There is a 'VaultAppPool' user.

I found the LocalSettings method.

The LocalSettings.LocalSettingsScope can be 'Client', 'IDE', or 'Admin'.

Which of these 3 would be appropriate?

Have set "C:\inetpub\wwwroot\VaultService\settings" as the second parameter.

But - am still receiving access denied messages from VP, although there now is a settings.xml file in my new subfolder named 'settings'..

I can't find any documentation to help without posting here...

Thanks !

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Thu Jan 30, 2014 10:16 am
Did you recompile your code with the new API and deploy those 7.x DLLs? That is needed so you can connect correctly to the new 7.1 server.
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Thu Jan 30, 2014 10:23 am
Thanks for chasing this one up.

Yes I have recompiled everything with the new DLL's.

My code:

VaultClientOperationsLib.LocalSettings.Init(LocalSettings.LocalSettingsScope.Admin ,"c:\\inetpub\\wwwroot\\website");

I set the correct perms for IIS_IUSRS and I now have a settings.xml being generated in the correct place.

This settings.xml file contains this single only:

<settings />

I can delete it and each time the file is generated fresh, but I still can't log on.

The ServerOperations.Login(); line fails with the error as before:
Couldn't calculate a local settings path for settings.xml. Tried both "" and "SourceGear".

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Wed Feb 05, 2014 3:48 am
Hi - Any help fixing this would be most useful. Our custom Vault Pro solution is unfortunately dead at the moment as we can't log in....

Am sure is something simple but our only option is to roll back to V6 unless we can resolve the error message.

Thanks !

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Wed Feb 05, 2014 9:57 am
I'm not sure that downgrading to version 6 would help this issue. I have one other user that had the same issue, but in his case, he was using version 6 and just moved to a different machine. It would work on one and not the other. I tested his code in-house on one of my machines and it worked here.

Do you have a different machine you could try your version 6 code on?

Try using a path that is the default location that other Vault clients would use. That path is C:/Users/your user name/appdata/local/Sourcegear. Is there any difference there?
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Wed Feb 05, 2014 10:45 am
We still have the old Windows 2003 server with V6 code running fine. The new Win2k8 with 7.1 is a different machine which we are migrating to, due to the old one being deprecated.

I tried to find out where the settings.xml file is on the old machine but had no success - couldn't find it :(

So,

As requested I changed the folder setting to:
"C:\\Users\\serverlocaladmin\\AppData\\Local\\SourceGear"
and
"C:\\Users\\serverlocaladmin\\AppData\\Local\\"
and
"C:\\Users\\serverlocaladmin\\AppData\\Local"

These gave me this error on login:
"Access to the path 'C:\Users\serverlocaladmin\AppData' is denied. "

I added IIS_USERS to permissions list on these folders - with Full Control:
Then I received the different message:
"Couldn't calculate a local settings path for settings.xml. Tried both "" and "SourceGear". "

No longer is Access Denied.

Doesn't appear to be a permissions issue.

What folder does VP expect to use as the default?

Posts: 8451
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
PostPosted: Wed Feb 05, 2014 2:33 pm
Just heard back from the other user that had this issue and using C:/Users/your user name/appdata/local/Sourcegear worked for that user.

When you are testing the application, are you logged into windows as your own user name or are you logged in as serverlocaladmin?

If you would like, I could see if I can get your code to run on one of my machines. To go that route, just send an email to support at sourcegear.com (attn: Beth) with a link to this forum thread.
Beth Kieler
SourceGear Technical Support

Posts: 126
Joined: Mon Apr 11, 2005 5:20 am
PostPosted: Mon Feb 10, 2014 5:21 am
Hi - I sent you the files as requested.

Is there any update?

Please let me know. Thanks !
Next

Return to Questions (API)

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

cron