Exe called from web service doesn't give results

P

pri_sh

I have a third party exe which takes in a set of arguments including
filenames and searches for information through it own server over the
internet and then writes results to output files. I got this exe to run
when called from a windows application in VB.NET. When I tried to do
the same using a webservice, the process.start runs without error and I
do not get any errors or output. No result files are generated. Can
someone tell me why this may be happening. I did create another exe in
VB which basically writes to a file. I called this exe from the
webservice and it worked and also created my file.

The code I am using is as below.

myProcess.StartInfo.FileName = "ThirdParty.exe"
args = "Someargs"
myProcess.StartInfo.Arguments = args
myProcess.StartInfo.WorkingDirectory = "<location path>"
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.ErrorDialog = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()
myProcess.WaitForExit()
Dim i As Integer = myProcess.ExitCode()
Dim sErr As String = myProcess.StandardError.ReadToEnd()
Dim sOut As String = myProcess.StandardOutput.ReadToEnd()

sOut shows correct information when running from windows app but none
when run rfom web service.
 
P

pri_sh

Additional Information:
The exe does give access to the ASPNET user which run the aspnet_wp.exe
 
P

pri_sh

Additional Information:
The exe does give access to the ASPNET user which run the aspnet_wp.exe
 
K

Katy King

The process may be in deadlock. Take a look at the examples on this page:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/frlrfsystemdiagnosticsprocessstartinfoclassredirectstandardoutputtopic.asp>

Katy

| From: (e-mail address removed)
|
| I have a third party exe which takes in a set of arguments including
| filenames and searches for information through it own server over the
| internet and then writes results to output files. I got this exe to run
| when called from a windows application in VB.NET. When I tried to do
| the same using a webservice, the process.start runs without error and I
| do not get any errors or output. No result files are generated. Can
| someone tell me why this may be happening. I did create another exe in
| VB which basically writes to a file. I called this exe from the
| webservice and it worked and also created my file.
|
| The code I am using is as below.
|
| myProcess.StartInfo.FileName = "ThirdParty.exe"
| args = "Someargs"
| myProcess.StartInfo.Arguments = args
| myProcess.StartInfo.WorkingDirectory = "<location path>"
| myProcess.StartInfo.CreateNoWindow = True
| myProcess.StartInfo.UseShellExecute = False
| myProcess.StartInfo.ErrorDialog = True
| myProcess.StartInfo.RedirectStandardError = True
| myProcess.StartInfo.RedirectStandardOutput = True
| myProcess.Start()
| myProcess.WaitForExit()
| Dim i As Integer = myProcess.ExitCode()
| Dim sErr As String = myProcess.StandardError.ReadToEnd()
| Dim sOut As String = myProcess.StandardOutput.ReadToEnd()
|
| sOut shows correct information when running from windows app but none
| when run rfom web service.
|
|
 
P

pri_sh

According to the example, the process would be in a deadlock and not
come out of it or go past the WaitForExit line, correct?
my code does go past the waitforExit line without any errors. It does
not hang. I did look at the task manager process once and after
process.start it takes about a couple of seconds to get to the
waitforexit line and the task manager shows that the process ends.
Besides this same code works perfectly fine when executed from a
windows app instead of a web service.
 

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

Top