我正在运行这个从预提交批处理文件启动的小型 C# 测试程序
private static int Test(string[] args)
{
var processStartInfo = new ProcessStartInfo
{
FileName = "svnlook.exe",
UseShellExecute = false,
ErrorDialog = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
Arguments = "help"
};
using (var svnlook = Process.Start(processStartInfo))
{
string output = svnlook.StandardOutput.ReadToEnd();
svnlook.WaitForExit();
Console.Error.WriteLine("svnlook exited with error 0x{0}.", svnlook.ExitCode.ToString("X"));
Console.Error.WriteLine("Current output is: {0}", string.IsNullOrEmpty(output) ? "empty" : output);
return 1;
}
}
我故意调用svnlook help
并强制错误,以便我可以看到提交时发生了什么。
当这个程序运行时,SVN 显示
svnlook 以错误 0xC0000135 退出。
当前输出为:空
我查找了错误 0xC0000135,这意味着App failed to initialize properly
虽然它不是特定于 svnhook。
为什么svnlook help
不返回任何东西?通过另一个进程执行时会失败吗?