Calling Process.Start from Webservice method hangs after first call

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
 
A

Aidy

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.
 
C

christian13467

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
 
B

bruce barker

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


-- bruce (sqlwork.com)
 
C

christian13467

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
 
A

Aidy

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.
 
C

christian13467

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
 
J

John Saunders

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top