简体   繁体   English

在ASP.NET Web服务中启动新过程

[英]Starting a new process in a asp.net web service

I have the following code: 我有以下代码:

 public void BeginConvert(object data)
 {
 ConverterData cObject = (ConverterData)data;
 string argument = string.Format("-i \"{0}\" -b {1} \"{2}\"", cObject.Source,    compression, cObject.Destiny);

 Process converterProcess = new Process();
 converterProcess.StartInfo.FileName = ffPath;
 converterProcess.StartInfo.Arguments = argument;
 converterProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
 converterProcess.Start();
 converterProcess.WaitForExit();
 }

I use it in a webservice, i start it in a new thread and it return exit code 1 (error, i'm trying to do a video convertion with ffmpeg library), i impersonate ASP.NET to use a local account with permissions to read and write files, when i run it in my machine running or debugging it works but know thta the web service is running in IIS doest'n. 我在Web服务中使用它,在新线程中启动它,并返回退出代码1(错误,我正尝试使用ffmpeg库进行视频转换),我模拟了ASP.NET以使用具有以下权限的本地帐户:读写文件,当我在运行或调试的机器上运行它时,它可以工作,但是知道Web服务正在IIS中运行。 Could someone help me? 有人可以帮我吗?

I can say with almost 100% certainty that this is a permissions issue. 我可以几乎100%地确定这是一个权限问题。 How are you doing the impersonation? 您如何进行模拟? Do you have the same username/password configured on the server? 您在服务器上配置了相同的用户名/密码吗?

Another possibility of course is that the target executable in StartInfo.FileName is not in the right place. 当然,另一种可能性是StartInfo.FileName中的目标可执行文件不在正确的位置。

Check the Event Viewer for unhandled exceptions and you may get more information. 检查事件查看器中是否有未处理的异常,您可能会获得更多信息。

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

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