473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Process.Start woes in ASP.Net application

I am at my witless end here, please help!

I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file selected
from a web page hosted on a unix driven file server. The user wants to have
this file converted to a pdf.

My page takes the query string and turns it into a windows unc path, then I
copy the file down to the web server and place it into a directory. This all
works fine.

The next step is to call an application that will convert the file into a
pdf, here is where the woes begin...

I have a 3rd party windows command line tool, installed on the same server
that my web app resides on, and it takes two parameters: fileIn and fileOut.

I am using Process.Start and ProcessStartInfo to call the conversion app
but it appears that the arguments are not getting through to it. I can see
the process running in Task Manager, but it hangs.

When I query the process through either Process.GetProcessById or
Process.GetProcessesByName, none of the ProcessStartInfo properties that I
have set have retained their value.

When I attempt to read the StandardOutput, I get an 'invalid character' error.

I have my web config set to <identity impersonate="true"/>, and have set the
IIS Directory Security anonymous user to the computer admin, for testing of
permissions.

Here is the code:

Dim procStringArgs As String = " /InFile " & Path & DrawingIn & " /OutFile "
& PDFOut & " /Hide"
'call conversion application with proc args
Dim proc As New Process
Dim procSI As New ProcessStartInfo
procSI.FileName = CONVERTER_FULLPATH
procSI.Arguments = procStringArgs
procSI.UseShellExecute = False
procSI.RedirectStandardOutput = True
procSI.RedirectStandardError = True
proc.StartInfo = procSI
proc.Start()
When I print out the FileName and Arguments to a log file this is the result:

FileName: C:\Program Files\[app dir]\[app].exe
proc args: /InFile c:\inetpub\wwwroot\[webapp]\InBox\[drawing].DWG /OutFile
c:\inetpub\wwwroot\[webapp]\OutBox\[drawing].pdf /Hide

The process runs under the Network Service username, which I have given full
access to the above directories, thinking it was a permissions issue.

Any suggestions greatly appreciated and eagerly implemented for testing,
thank you.
--
Coding in Sunny Central Florida
May 1 '07 #1
4 2849
I would like to follow up with some more information that may be helpful to
those trying to help me.

Pasting the app name and arguments from my log file into a command window or
the run command works fine.

Also, I took my code from the web app and put it into a windows form, and it
worked fine.

This makes me think that there is an issue with communicating from an
ASP.Net web app hosted in IIS to an executable file on the server, and
passing arguments to the executable.
--
Coding in Sunny Central Florida
"VB Jonnie" wrote:
I am at my witless end here, please help!

I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file selected
from a web page hosted on a unix driven file server. The user wants to have
this file converted to a pdf.

My page takes the query string and turns it into a windows unc path, then I
copy the file down to the web server and place it into a directory. This all
works fine.

The next step is to call an application that will convert the file into a
pdf, here is where the woes begin...

I have a 3rd party windows command line tool, installed on the same server
that my web app resides on, and it takes two parameters: fileIn and fileOut.

I am using Process.Start and ProcessStartInfo to call the conversion app
but it appears that the arguments are not getting through to it. I can see
the process running in Task Manager, but it hangs.

When I query the process through either Process.GetProcessById or
Process.GetProcessesByName, none of the ProcessStartInfo properties that I
have set have retained their value.

When I attempt to read the StandardOutput, I get an 'invalid character' error.

I have my web config set to <identity impersonate="true"/>, and have set the
IIS Directory Security anonymous user to the computer admin, for testing of
permissions.

Here is the code:

Dim procStringArgs As String = " /InFile " & Path & DrawingIn & " /OutFile "
& PDFOut & " /Hide"
'call conversion application with proc args
Dim proc As New Process
Dim procSI As New ProcessStartInfo
procSI.FileName = CONVERTER_FULLPATH
procSI.Arguments = procStringArgs
procSI.UseShellExecute = False
procSI.RedirectStandardOutput = True
procSI.RedirectStandardError = True
proc.StartInfo = procSI
proc.Start()
When I print out the FileName and Arguments to a log file this is the result:

FileName: C:\Program Files\[app dir]\[app].exe
proc args: /InFile c:\inetpub\wwwroot\[webapp]\InBox\[drawing].DWG /OutFile
c:\inetpub\wwwroot\[webapp]\OutBox\[drawing].pdf /Hide

The process runs under the Network Service username, which I have given full
access to the above directories, thinking it was a permissions issue.

Any suggestions greatly appreciated and eagerly implemented for testing,
thank you.
--
Coding in Sunny Central Florida
May 1 '07 #2
Jonnie,

A few things I would like to know:

1) Does the application have full trust in the GAC?
2) Have you tried http://localhost... instead?
3) What permissions do you have on the server for this to run?
4) Your path (path & file...) Path.Combine(path, file)... & is the a space
after the filename & before the out switch?
5) Is IIS 6 & directory have execute permissions?

These are the types of things worth checking.

Please post back your findings,

--
Newbie Coder
(It's just a name)
"VB Jonnie" <VB******@discussions.microsoft.comwrote in message
news:0D**********************************@microsof t.com...
I would like to follow up with some more information that may be helpful
to
those trying to help me.

Pasting the app name and arguments from my log file into a command window
or
the run command works fine.

Also, I took my code from the web app and put it into a windows form, and
it
worked fine.

This makes me think that there is an issue with communicating from an
ASP.Net web app hosted in IIS to an executable file on the server, and
passing arguments to the executable.
--
Coding in Sunny Central Florida
"VB Jonnie" wrote:
I am at my witless end here, please help!

I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file
selected
from a web page hosted on a unix driven file server. The user wants to
have
this file converted to a pdf.

My page takes the query string and turns it into a windows unc path,
then I
copy the file down to the web server and place it into a directory. This
all
works fine.

The next step is to call an application that will convert the file into
a
pdf, here is where the woes begin...

I have a 3rd party windows command line tool, installed on the same
server
that my web app resides on, and it takes two parameters: fileIn and file
Out.

I am using Process.Start and ProcessStartInfo to call the conversion
app
but it appears that the arguments are not getting through to it. I can
see
the process running in Task Manager, but it hangs.

When I query the process through either Process.GetProcessById or
Process.GetProcessesByName, none of the ProcessStartInfo properties that
I
have set have retained their value.

When I attempt to read the StandardOutput, I get an 'invalid character'
error.

I have my web config set to <identity impersonate="true"/>, and have set
the
IIS Directory Security anonymous user to the computer admin, for testing
of
permissions.

Here is the code:

Dim procStringArgs As String = " /InFile " & Path & DrawingIn & "
/OutFile "
& PDFOut & " /Hide"
'call conversion application with proc args
Dim proc As New Process
Dim procSI As New ProcessStartInfo
procSI.FileName = CONVERTER_FULLPATH
procSI.Arguments = procStringArgs
procSI.UseShellExecute = False
procSI.RedirectStandardOutput = True
procSI.RedirectStandardError = True
proc.StartInfo = procSI
proc.Start()
When I print out the FileName and Arguments to a log file this is the
result:

FileName: C:\Program Files\[app dir]\[app].exe
proc args: /InFile c:\inetpub\wwwroot\[webapp]\InBox\[drawing].DWG
/OutFile
c:\inetpub\wwwroot\[webapp]\OutBox\[drawing].pdf /Hide

The process runs under the Network Service username, which I have given
full
access to the above directories, thinking it was a permissions issue.

Any suggestions greatly appreciated and eagerly implemented for testing,
thank you.
--
Coding in Sunny Central Florida

May 2 '07 #3
Thank you so much for the response, I will try to answer your questions as
best I can...

1) Does the application have full trust in the GAC?
A) I tried to drag and drop the executable into the Windows\assembly folder,
but it said that the executable was expected to have a manifest.
2) Have you tried http://localhost... instead?
A) Not yet, I will try that today.
3) What permissions do you have on the server for this to run?
A) This is being run through IIS with integrated windows authentication
turned on and an administrator as the anonymous access user. I test from my
machine and remote into the server as administrator to keep work on IIS and
read my log files.
4) Your path (path & file...) Path.Combine(path, file)... & is the a space
after the filename & before the out switch?
A) Yes, I am pretty sure... I have tweaked the dickens out of that string
trying to get the call to work, and it looks right now ( "app_path" "
/switches..." )
5) Is IIS 6 & directory have execute permissions?
A) Interesting point. Short answer is yes. Long story is that I was not able
to publish to the server until FrontPage server extensions were installed.
Now when I publish I have to change the 'Scripts and Executables' Execute
permissions to Scripts only and then 'Convert the Server Extensions 2002 Web
to Driectory'. If I do not I get a publish error that states that I cannot
place files in a directory marked as executable, or that it cannot find the
directory. So I change them back and forth between testing and publishing -
ugh.

Thank you for your interest in helping with this, I really appreciate it.

--
Coding in Sunny Central Florida
"Newbie Coder" wrote:
Jonnie,

A few things I would like to know:

1) Does the application have full trust in the GAC?
2) Have you tried http://localhost... instead?
3) What permissions do you have on the server for this to run?
4) Your path (path & file...) Path.Combine(path, file)... & is the a space
after the filename & before the out switch?
5) Is IIS 6 & directory have execute permissions?

These are the types of things worth checking.

Please post back your findings,

--
Newbie Coder
(It's just a name)
"VB Jonnie" <VB******@discussions.microsoft.comwrote in message
news:0D**********************************@microsof t.com...
I would like to follow up with some more information that may be helpful
to
those trying to help me.

Pasting the app name and arguments from my log file into a command window
or
the run command works fine.

Also, I took my code from the web app and put it into a windows form, and
it
worked fine.

This makes me think that there is an issue with communicating from an
ASP.Net web app hosted in IIS to an executable file on the server, and
passing arguments to the executable.
--
Coding in Sunny Central Florida
"VB Jonnie" wrote:
I am at my witless end here, please help!
>
I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file
selected
from a web page hosted on a unix driven file server. The user wants to
have
this file converted to a pdf.
>
My page takes the query string and turns it into a windows unc path,
then I
copy the file down to the web server and place it into a directory. This
all
works fine.
>
The next step is to call an application that will convert the file into
a
pdf, here is where the woes begin...
>
I have a 3rd party windows command line tool, installed on the same
server
that my web app resides on, and it takes two parameters: fileIn and file
Out.
>
I am using Process.Start and ProcessStartInfo to call the conversion
app
but it appears that the arguments are not getting through to it. I can
see
the process running in Task Manager, but it hangs.
>
When I query the process through either Process.GetProcessById or
Process.GetProcessesByName, none of the ProcessStartInfo properties that
I
have set have retained their value.
>
When I attempt to read the StandardOutput, I get an 'invalid character'
error.
>
I have my web config set to <identity impersonate="true"/>, and have set
the
IIS Directory Security anonymous user to the computer admin, for testing
of
permissions.
>
Here is the code:
>
Dim procStringArgs As String = " /InFile " & Path & DrawingIn & "
/OutFile "
& PDFOut & " /Hide"
'call conversion application with proc args
Dim proc As New Process
Dim procSI As New ProcessStartInfo
procSI.FileName = CONVERTER_FULLPATH
procSI.Arguments = procStringArgs
procSI.UseShellExecute = False
procSI.RedirectStandardOutput = True
procSI.RedirectStandardError = True
proc.StartInfo = procSI
proc.Start()
>
>
When I print out the FileName and Arguments to a log file this is the
result:
>
FileName: C:\Program Files\[app dir]\[app].exe
proc args: /InFile c:\inetpub\wwwroot\[webapp]\InBox\[drawing].DWG
/OutFile
c:\inetpub\wwwroot\[webapp]\OutBox\[drawing].pdf /Hide
>
The process runs under the Network Service username, which I have given
full
access to the above directories, thinking it was a permissions issue.
>
Any suggestions greatly appreciated and eagerly implemented for testing,
thank you.
>
>
--
Coding in Sunny Central Florida


May 2 '07 #4
I checked the event logs and found the following error directed from the 3rd
party conversion app that I am calling:

Event Type: Information
Event Source: Application Popup
Event Category: None
Event ID: 26
Description:
Application popup: conversionapp.exe - Application Error : The application
failed to initialize properly (0xc0000142). Click on OK to terminate the
application.
--
Coding in Sunny Central Florida

May 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
6
by: Dmitri Shvetsov | last post by:
Hi, Can I start an external process from the Web Service? I'm using a code, compiler keeps silence, compiles ok and starts the project. When I trace in Debugger it doesn't start an external...
6
by: gizmo | last post by:
I have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). My problem is that I need to kill each...
12
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
2
by: Grande | last post by:
Hi all, I recently changed a webservice to take in a third parameter, and it hasn't been working since. I get the following error at runtime: "Server was unable to process request. ---Method...
1
by: Chris | last post by:
Hello, I have a Windows Forms application which has buttons to click to run other programs. One of the applications it must run is a ClickOnce Windows Forms application, so the Application...
0
by: =?Utf-8?B?Um9i?= | last post by:
I've a requirement to monitor when certain applications are started. I'm using WMI called from VS Stusio 2005 in VB to trap Excel and Word starting. I've written the following console application...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.