[英]Starting .Net web service on the same port as the ASP.Net application
[英]Starting a new process in a asp.net web service
我有以下代碼:
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();
}
我在Web服務中使用它,在新線程中啟動它,並返回退出代碼1(錯誤,我正嘗試使用ffmpeg庫進行視頻轉換),我模擬了ASP.NET以使用具有以下權限的本地帳戶:讀寫文件,當我在運行或調試的機器上運行它時,它可以工作,但是知道Web服務正在IIS中運行。 有人可以幫我嗎?
我可以幾乎100%地確定這是一個權限問題。 您如何進行模擬? 您在服務器上配置了相同的用戶名/密碼嗎?
當然,另一種可能性是StartInfo.FileName中的目標可執行文件不在正確的位置。
檢查事件查看器中是否有未處理的異常,您可能會獲得更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.