【发布时间】:2011-01-28 06:57:16
【问题描述】:
我正在运行这个从预提交批处理文件启动的小型 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 没有返回任何东西?通过另一个进程执行时会失败吗?
【问题讨论】:
标签: c# svn pre-commit-hook