I've got an application we use to build our code projects, and yesterday I released an update to it. Several of the guys here started getting an error when the application tries logging into the Vault server. The error occurs when I perform a client.Refresh() after logging in. The error recieved is:
System.IO.FileNotFoundException: Could not find file "C:\WINNT\Temp\SourceGearCache\Vault_1\Client\2E3B5E28-4282-4918-971D-A06FB90F1FC2\lkoskovich\_sgvault\-480104859\74249.186780".
File name: "C:\WINNT\Temp\SourceGearCache\Vault_1\Client\2E3B5E28-4282-4918-971D-A06FB90F1FC2\lkoskovich\_sgvault\-480104859\74249.186780"
Indeed, there was no "-480104859" directory in the _sgvault folder. Then, on a whim, I went ahead and deleted the entire cache folder and retried the app. That worked like a charm. So I'm curious if anyone has any idea what would've caused this. Why would it be looking for a directory that wasn't there? And why would deleting the cache folder make it work?
Since it works now, there's no more problem. But I'm just trying to get a better understanding of things so that I can avoid these issues in the future. Thanks.
Vault Client API Error
Moderator: SourceGear
I found the cause of my problem here. When I'm setting the properties of the Vault client object, I'm setting:
client.WorkingFolderOptions.StoreDataInWorkingFolders = False;
The user who consistently gets the error I mentioned above has their Vault "Store Working Folder State/Baseline Files" setting set to In Working Folders. It gets an IO error trying to read the attributes of a baseline file. That file does actually exist, but in a different location. It exists in the working folder location, but the client object is looking for it in the Client Cache Folder location. Presumably, the Vault client creates the baseline file in the working folder, based on the user's Vault settings, but the client object in my application is looking for it in the cache folder based on my setting the StoreDataInWorkingFolders flag to False. When I remove that from my code, the problem is solved.
Interestingly, I've also found that deleting the CacheMember_WorkingFolderAssignments file makes the error go away, though only temporarily of course.
client.WorkingFolderOptions.StoreDataInWorkingFolders = False;
The user who consistently gets the error I mentioned above has their Vault "Store Working Folder State/Baseline Files" setting set to In Working Folders. It gets an IO error trying to read the attributes of a baseline file. That file does actually exist, but in a different location. It exists in the working folder location, but the client object is looking for it in the Client Cache Folder location. Presumably, the Vault client creates the baseline file in the working folder, based on the user's Vault settings, but the client object in my application is looking for it in the cache folder based on my setting the StoreDataInWorkingFolders flag to False. When I remove that from my code, the problem is solved.
Interestingly, I've also found that deleting the CacheMember_WorkingFolderAssignments file makes the error go away, though only temporarily of course.