Calling Process.Start from Webservice method hangs after first call

  • Thread starter Thread starter christian13467
  • Start date Start date
C

christian13467

Hi,

I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling
a commandline program or a cmd file using Process.Start inside a
webservice method. The call to Process.Start returns once after
restarting the iis. A second call to my webservice method never
returns.

I found some post wich where fixed checking access rights. I added
ASPNET to administrators group with no success.

My question is why the call hangs second time?
Any idea,

Christian
 
The answer depends on what this command-line app is doing. The general
advice is to just not do what you're doing. Just cos you can spawn
processes doesn't mean it is suitable to spawn any application you want from
an asp.net page.
 
Hi Aidy,

the command line app is generating some some data and building a pdf
file which my webservice method has to deliver back. It runs all fine,
if I do that with a standard c# program. But something in asp.net is
blocking the call. Do you know who?

Cheers,
Christian
 
the spawned program is probably waiting for console input, and your app
is not sending any.


-- bruce (sqlwork.com)
 
Hi bruce,

the program itself is not asking for anything. I can run the program
as logged on user without any error or warnings.
It might be that someone else is poping up what I cannot see because
its not shown. Are there some restrictions in calling processes from
asp.net?

Cheers,
Christian
 
If it is generating a pdf file I'd first check that your anonymous asp.net
user has write access on the directory it is saving the file to.
 
I made him an administrator.

The curios moment is, that the program starts and runs in the
background. But simply the call Process.Start never returns. I put it
into an exception handler, but there is no exception thrown.

- Christian
 
I made him an administrator.

The curios moment is, that the program starts and runs in the
background. But simply the call Process.Start never returns. I put it
into an exception handler, but there is no exception thrown.

You should put some exception logging into the PDF program. Don't just make
the user an administrator and assume that you've succeeded, so it must be
something else.

What would have happened if, for some other reason, the user had been able
to write to the output directory? Would the program have written an error
message to the system event log? If so, then look at the event log to see if
that happened when started by ASP.NET.

If not, then add the code to write error messages to the event log (not to a
file!). Then try again and see what happens.

John
 
Back
Top