我正在运行这个从预提交批处理文件启动的小型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将显示
存在错误0xC0000135的
svnlook。
当前输出为:空
我查找了0xC0000135错误,它的意思是App failed to initialize properly,尽管它并不是特定于svn钩子的。
为什么svnlook help不返回任何东西?它是否在通过另一个进程执行时失败?
发布于 2010-03-17 15:19:26
我有一个类似的应用程序,叫做,工作正常,有两样东西需要检查/尝试。
https://stackoverflow.com/questions/2457535
复制相似问题