简体   繁体   English

服务器端应用程序无法运行命令

[英]Server-side application fails to run command

I have an ASP.NET application that is already deployed in an Azure virtual machine. 我有一个已经部署在Azure虚拟机中的ASP.NET应用程序。 The situation is as follows: 情况如下:

This application, OCREngine , is deployed on the server along with other 3rd party applications. 该应用程序OCREngine与其他第三方应用程序一起部署在服务器上。 OCREngine is executed on the server by using a service reference to the web service. 通过使用对Web服务的服务引用在服务器上执行OCREngine。 It runs fine most of the time. 大多数情况下,它运行良好。 But there is one exception: one of the branches of execution won't run the program it needs to run. 但是有一个例外:执行分支之一不会运行它需要运行的程序。 Both of the branches have to run a program (both are being run in the same way), but one works and the other one doesn't. 两个分支都必须运行一个程序(两个都以相同的方式运行),但是一个分支起作用,而另一个分支则没有。

This one works: CleanJPEG.exe 这有效: CleanJPEG.exe

proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "CleanJPEG.exe";
proc.StartInfo.Arguments = "\"" + tempPages + "Color Info.JPEG\"";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();

And this one doesn't: cpctool.exe 而且这个没有: cpctool.exe

proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "cpctool.exe";
proc.StartInfo.Arguments = "\"" + file + "\" -o \"" + tempPages + "page.tiff\"";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();

They are both in the same folder, which has full permissions for the AppPool and so does %TEMP%. 它们都在同一个文件夹中,该文件夹具有AppPool的完全权限,%TEMP%也是如此。

If I run the application from the server, everything works fine. 如果我从服务器运行该应用程序,则一切正常。 But when I run it through the web service, an instance of cpctool.exe gets created (can be seen on Background processes in the task manager) but it doesn't do it's job. 但是,当我通过Web服务运行它时,会创建cpctool.exe的一个实例(可以在任务管理器的“后台”进程中看到),但是它没有完成它的工作。 And thus the execution of OCREngine never finishes. 因此,OCREngine的执行永远不会完成。

This last part is what made me think it was a problem with permissions, but I don't know what else to give permissions to. 这最后一部分使我认为这是权限问题,但是我不知道要赋予权限什么。

I run Folder Changes View on cpctool.exe and it showed access to the folder where the files are stored and one file being saved in %TEMP% (which, funny enough, doesn't appear when running Folder Changes View on the server). 我在cpctool.exe上运行“ 文件夹更改视图 ”,它显示了对存储文件的文件夹的访问权限,并且一个文件正在%TEMP%中保存(这很有趣,在服务器上运行“文件夹更改视图”时不会出现)。

Can anyone think of any special folder that needs permission that I might be forgetting? 谁能想到任何需要我忘记的特殊文件夹?

You are completely correct to concentrrate on the permissions as that is usually the issue. 您完全正确地专注于权限,因为通常这是问题所在。

If an EXE process starts and does nothing, then it's probably only made for interactive use, and is prompting for something. 如果EXE进程启动且不执行任何操作,则它可能仅用于交互目的,并提示您执行某些操作。

Looking at this page it says: 看着这个页面说:

The FIRST TIME the CPCTool.exe runs the user is prompted to read/accept a User Agreement from Cartesian – this agreement MUST be accepted or the converter will not work. 首次运行CPCTool.exe时,系统会提示用户阅读/接受笛卡尔的用户协议-必须接受该协议,否则转换器将无法工作。

I reckon that's what it's doing. 我认为这就是它的作用。 Try logging in as the application pool user, start the program and accept the agreement. 尝试以应用程序池用户身份登录,启动程序并接受协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM