Hudson自动构建,命令行调用exe,Process.Start().

Started by user anonymous
No emails were triggered.
[workspace] $ cmd /c call C:\tools\tomcat6\temp\hudson8584936246756672219.bat

C:\tools\tomcat6\webapps\hudson-3.0.0\tempdir\jobs\UserCenter_TA\workspace>C:\tools\tomcat6\webapps\hudson-3.0.0\WEB-INF\Test28.exe

Unhandled Exception: System.ComponentModel.Win32Exception: 系统找不到指定的文件。
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Test28.Program.Main(String[] args) in E:\mt\3\3-27\Nunit\Solution1\Test28\Program.cs:line 23

C:\tools\tomcat6\webapps\hudson-3.0.0\tempdir\jobs\UserCenter_TA\workspace>exit 255 
Email was triggered for: Failure
Sending email for trigger: Failure
Sending email to: xxx@qq.com
Finished: FAILURE


====================================================

直接双击exe文件,可正常执行,在服务器上直接从命令行来执行也没问题。

远程通过Hudson来调用该exe文件则不行。

问题尚未解决,标记下,待解决。

相关出错的部分代码为:

Process vProcess = new Process();
            vProcess.StartInfo.FileName = "nunit-console.exe";
            vProcess.StartInfo.UseShellExecute = false;
            vProcess.StartInfo.RedirectStandardInput = true;
            vProcess.StartInfo.RedirectStandardOutput = true;
            vProcess.StartInfo.RedirectStandardError = true;
            vProcess.StartInfo.CreateNoWindow = false;
            vProcess.StartInfo.Arguments = @"C:\Apps\UserCenterTester\CQTest\CQTest\TestUserCentre\bin\Debug\TestUserCentre.dll";
            vProcess.Start();

  上面的 vProcess.Start(); 执行到这一步就报错。

初步怀疑是权限问题所致,但未发现具体是哪里的问题。

posted on 2013-03-28 08:32  。!  阅读(377)  评论(0编辑  收藏  举报