SVN post-commit只能手动完成

时间:2010-02-01 07:35:41

标签: svn tortoisesvn post-commit

HI,

我创建了一个名为post-commit.bat的批处理文件,并将其放在/ hooks目录下。

该文件的内容是:

TestCS.exe

exe文件的内容是:

static void Main(string[] args)
    {

        try
        {
            // create a writer and open the file
            TextWriter tw = new StreamWriter("date.txt");

            // write a line of text to the file
            tw.WriteLine(DateTime.Now);

            // close the stream
            tw.Close();
        }
        catch { }
    }

当我双击post-commit.bat时,它会创建date.txt文件。

当我在SVN中提交时,需要时间,最终会给我以下消息: alt text http://img688.imageshack.us/img688/3894/exception.jpg

可能是什么问题?

谢谢!

1 个答案:

答案 0 :(得分:1)

显而易见的事情是启动调试器并更好地了解问题发生的位置。

建议您为using使用TextWriter语句,并避免捕获和吞下所有异常,而不会尝试记录错误。

真的你的整个代码吗?您根本没有使用args?很难看出该代码将如何导致IndexOutOfRangeException ...