1

你好,

我创建了一个名为 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

可能是什么问题?

谢谢!

4

1 回答 1

1

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

建议您应该using为您TextWriter的 .

真的是你的全部代码吗?你根本不用args?很难看出该代码将如何导致IndexOutOfRangeException...

于 2010-02-01T07:41:01.447 回答