Why does external process in ASP.NET application fail?

I have some code that is running in an ASP.NET application that runs a command line process that uses PSCP.EXE (Putty) to copy a file from an external Linux server to the local server. When I run the ASP.NET application interactively by using the Run command in Visual Studio 2010 it works fine. However, when I deploy the application to IIS (on the same server!) and try to run it I get an error coming back from the PSCP.EXE command line. The error is this:Fatal: Network error: Connection timed outI did a little research about that PSCP.EXE error and the only thing I found was people suggesting that the port needed to be specified. But I don't think that would apply to me since it works fine when I run the app through Visual Studio.Does anyone know why I would get a connection timed out error when running the command from IIS 7 on my box, but when I run it through Visual Studio on the same box it works fine?Here is my code:\[code\]string _pscpExePath = ConfigurationManager.AppSettings["PSCPExePath"];string _localOptionsFolder = ConfigurationManager.AppSettings["LocalOptionsFileFolder"];string _remoteOptionsLocation = ConfigurationManager.AppSettings["RemoteOptionsFileLocation"];ProcessStartInfo _procStartInfo = new ProcessStartInfo("cmd", "/c " + _pscpExePath + " -pw " + App.ConfigData.ModemAdminPassword + " root@" + App.ConfigData.ModemIPAddress + ":" + _remoteOptionsLocation + " " + _localOptionsFolder);_procStartInfo.RedirectStandardOutput = true;_procStartInfo.RedirectStandardError = true;_procStartInfo.UseShellExecute = false;_procStartInfo.CreateNoWindow = true;using (Process _proc = Process.Start(_procStartInfo)){ using (StreamReader _reader = _proc.StandardOutput) { string _result = _reader.ReadToEnd(); log.Info("Get Options File Result = " + _result); } using (StreamReader _error = _proc.StandardError) { string _result = _error.ReadToEnd(); log.Info("Get Options File Error = " + _result); }}\[/code\]
 
Back
Top