I can't be sure if this is an issue specific to Accurev, or is more to do with calling the command line from C#. I'll make the question and its tags more specific when I work out which it is.
I've got the following two calls that I can successfully make using command prompt :
- accurev stat -d -s "ProductionSupport" -fx
- accurev hist -s "ProductionSupport" -ftx -e "1570567"
And in both cases I can see xml as a result.
However I want to make these calls from a C# program, and the first one of those works great but inexplicably the second one returns an empty string.
public string CallAccurev(string arguments)
{
Process cmdUtility = new Process
{
StartInfo =
{
FileName = "C:\\Program Files (x86)\\AccuRev v5.5\\bin\\accurev.exe",
Arguments = arguments,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
}
};
cmdUtility.Start();
var s = cmdUtility.StandardOutput.ReadToEnd();
cmdUtility.WaitForExit();
return s;
}
My calls look like this :
var checkInComment = CallAccurev("hist -s " + _streamName + " -e " + Convert.ToString(processedFile.TransId) + " -ftx");
var filesString = CallAccurev("stat -d -s " + _streamName + " -fex");
As an attempt to get around this I've tried putting my "hist" call and its parameters into a .Bat file. I can see that double clicking that file gives the intended behaviour but when I call it from code I get empty strings again.
Any answers or clues on how to debug what is happening during my hist call are greatly appreciated!