【问题标题】:svnlook always returns an error and no outputsvnlook 总是返回错误并且没有输出
【发布时间】: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


    【解决方案1】:

    我有一个类似的应用程序,它使用 svnlook 并且运行良好,需要检查/尝试两件事。

    1. 检查 svnlook 是否包含在您的系统路径中(通过打开命令提示符并输入 svnlook 并检查它是否输出正常(输入“svnlook help”以了解用法)进行测试)
    2. 尝试重新安装您的 svn 工具,可能 svnlook 以某种方式损坏。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-17
      • 2018-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多