我试图调用一个辅助角色中的可执行文件中调用EXE的Azure的辅助角色
我尝试了不同的可执行文件:
1-program1.exe (C code compiled with visual studio, target: Win32)
2-program2.exe (C# code, target: x86, this is a dummy program it only creates a text file)
3-program3.exe (C code compiled with visual studio, target: win32, this is a dummy program it only creates a text file)
我的目标是能够运行program1.exe 。
结果:
1- no signs of success. It should generate some files for any successful run. No files were generated.
2- success. It creates the text file.
3- no signs of success. No file was generated.
所以,我想了解为什么program1.exe不工作,但找不到原因。我明白这个问题不是特定于program1.exe的。对于任何win32应用程序,这是有问题的。
这可能是什么原因?
这里是一个与调用外部应用程序处理的部分代码:
var localStorage = RoleEnvironment.GetLocalResource("WorkerLocalStorage");
String workingDir = localStorage.RootPath + @"job";
var appRoot = Path.Combine(Environment.GetEnvironmentVariable("RoleRoot")
+ @"\", @"approot");
String workingDir = localStorage.RootPath + @"job";
String cmdline = "command1 command2";
ProcessStartInfo startinfo = new ProcessStartInfo();
startinfo.CreateNoWindow = false;
startinfo.UseShellExecute = true;
startinfo.FileName = Path.Combine(appRoot, @"program1.exe");
//startinfo.FileName = Path.Combine(appRoot, @"program2.exe");
//startinfo.FileName = Path.Combine(appRoot, @"program3.exe");
startinfo.Arguments = cmdline;
startinfo.WorkingDirectory = workingDir;
Process exeProcess = Process.Start(startinfo);
exeProcess.WaitForExit();
program2.exe工作的话,我没有任何问题与文件上传到一个blob。我找不到问题。它可能与传递命令行参数有关吗?我需要为C编码的可执行文件指定其他内容吗?
顺便说一句,所有的测试都成功在模拟器(即开发环境)
我会尝试远程桌面到机器中,看看它在命令窗口中的作用。以下是关于如何远程连接到计算机的信息的链接:http://msdn.microsoft.com/en-us/library/gg443832.aspx – 2011-06-09 11:25:23
嗯,我可以连接到其中一个工作人员。我怎样才能看到命令窗口?我试过了,什么也看不见。在模拟器中,它打开命令提示符并运行程序。他们是控制台应用程序,我应该看到一个命令窗口,对吗? – 2011-06-09 21:09:41
不要伪造Process Monitor - 你可以将它复制到角色上,然后运行并查看所有缺失的依赖关系。 – sharptooth 2011-06-10 06:03:14