Hey guys,
To begin with, i am using the API from release 4.1.2 (18185)
I have code that calls VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout and ProcessCommandCommit.
All of the code has worked previously - now all of the sudden, the code executes, but the Checkout / Commit never occurs, and there are no exceptions thrown.
I have a older executable that runs the same code as above on the same machine , and works properly.
Any idea what would cause the ProcessCommandCheckout / Commit to appear to run sucessfully, yet not actually do anything?
Strange situation where API stops functioning
Moderator: SourceGear
Re: Strange situation where API stops functioning
Does it work with 4.1.3? How old is the old version it works with?
Can you post a code snippet?
Can you post a code snippet?
Re: Strange situation where API stops functioning
Here is a code snippet. This is exactly the same code the 'old version' uses, against the same vault (Ver 4.1.2), repository, user, ect. I am unable to test this on 4.1.3 unfortunately, as we are only using 4.1.2 now.
----------------
Public Sub Checkout(ByVal DatabaseName As String, ByVal SnapshotVaultFilePath As String, ByVal VaultEnvironmentToBuild As String)
Dim MyOptions As New VaultClientIntegrationLib.GetOptions
Dim PathToVaultFolder As String = "$/" & SnapshotVaultFilePath & "/"
Dim PathToSnapshots As String = "C:\Snapshots\" & VaultEnvironmentToBuild & DatabaseName
VaultClientIntegrationLib.ServerOperations.SetWorkingFolder(PathToVaultFolder, PathToSnapshots, False)
Dim CheckedOutSnapshot As String()
ReDim CheckedOutSnapshot(0)
CheckedOutSnapshot.SetValue("$/" & SnapshotVaultFilePath & "/" & DatabaseName & ".snp", 0)
VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout(CheckedOutSnapshot, True, True, MyOptions)
ServerOperations.client.ClientInstance.Refresh()
End Sub
Public Sub CheckIn(ByVal SnapshotVaultFilePath As String, ByVal CurrentEnvironment As String)
Dim ChangeSet As VaultClientOperationsLib.ChangeSetItemColl
ChangeSet = VaultClientIntegrationLib.ServerOperations.ProcessCommandListChangeSet(CheckedOutSnapshot)
ServerOperations.client.ClientInstance.Refresh()
ServerOperations.client.Comment = CurrentEnvironment & "- " & System.DateTime.Now
ServerOperations.ProcessCommandCommit(ChangeSet, UnchangedHandler.Checkin, False, VaultClientOperationsLib.LocalCopyType.Replace, False)
ServerOperations.client.ClientInstance.Refresh()
End Sub
---Again, much thanks for the help, it is very much appreciated!
-Chris
----------------
Public Sub Checkout(ByVal DatabaseName As String, ByVal SnapshotVaultFilePath As String, ByVal VaultEnvironmentToBuild As String)
Dim MyOptions As New VaultClientIntegrationLib.GetOptions
Dim PathToVaultFolder As String = "$/" & SnapshotVaultFilePath & "/"
Dim PathToSnapshots As String = "C:\Snapshots\" & VaultEnvironmentToBuild & DatabaseName
VaultClientIntegrationLib.ServerOperations.SetWorkingFolder(PathToVaultFolder, PathToSnapshots, False)
Dim CheckedOutSnapshot As String()
ReDim CheckedOutSnapshot(0)
CheckedOutSnapshot.SetValue("$/" & SnapshotVaultFilePath & "/" & DatabaseName & ".snp", 0)
VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout(CheckedOutSnapshot, True, True, MyOptions)
ServerOperations.client.ClientInstance.Refresh()
End Sub
Public Sub CheckIn(ByVal SnapshotVaultFilePath As String, ByVal CurrentEnvironment As String)
Dim ChangeSet As VaultClientOperationsLib.ChangeSetItemColl
ChangeSet = VaultClientIntegrationLib.ServerOperations.ProcessCommandListChangeSet(CheckedOutSnapshot)
ServerOperations.client.ClientInstance.Refresh()
ServerOperations.client.Comment = CurrentEnvironment & "- " & System.DateTime.Now
ServerOperations.ProcessCommandCommit(ChangeSet, UnchangedHandler.Checkin, False, VaultClientOperationsLib.LocalCopyType.Replace, False)
ServerOperations.client.ClientInstance.Refresh()
End Sub
---Again, much thanks for the help, it is very much appreciated!
-Chris
Re: Strange situation where API stops functioning
The 4.1.3 api is compatible with the 4.1.2 server. Do you know what version this "old" version is?