|
Home > Archive > IIS Server > July 2005 > Running External Processes in .NET with Win2K3/IIS 6
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Running External Processes in .NET with Win2K3/IIS 6
|
|
|
| I have an interesting problem that I believe has to do with some IIS 6
settings that I am not aware of and I have just about exhausted searching
google and this discussion group. Hopefully, someone here can shed some
light on the issue I am having.
Anyway, in my .NET web application, I am using a third party class library
(bzwhll.dll) to communicate with a backend IBM z800 host system. This
library spawns a process (bzmd.exe) and interacts with it to read and write
to mainframe host screens using a combnation of DDE, telnet and winHLLAPI. I
developed the web app on a winXP system with IIS5 installed. On this
development system, the app works just fine. When I moved the app to our
win2k3/IIS6 development server, however, the web app did not work properly.
The bzmd.exe process is spawned just fine (I can see it running as NETWORK
SERVICE in the task manager) but it doesn't seem like the w3wp.exe process
can interact with the bzmd.exe process once that process is started (it
doesn't even kill the process after the script has finished running even
though it did on the winXP/IIS5 system and the code calls those commands).
When I run the script, there are no messages in the Event logs to indicate
any error nor are there any exceptions thrown in the code. ASP.NET is
installed correctly on the server and is working fine.
Some things I have already tried:
-I've tried running the w3wp.exe process as my user account (which is an
administrator), and running the iis admin and w3 publishing services as my
user with "interact with desktop" checked. One thing that I noticed in this
situation was that, when remote desktoped into this machine and running this
test script, the bzmd.exe processes were running under my user account but
did not show up as an active window on the desktop (I guess this is because
IIS6 runs processes in it's own isolated space?).
-I've also given "Everyone" full permissions to the entire C: drive with
the same problem, so I don't think it's a folder/file permission issue.
Maybe a security policy issue in IIS6?
To make matters even worse, I wrote a small .NET console app that uses the
SAME exact classes libraries and code as the webapp (which I then ran under
the same admin account that I ran the webapp as), that connected to the
mainframe and ran fine. I am at wits end here about this solution, which
works fine on another machine running winXP/IIS5 but not on this win2k3/IIS6
machine, even though the console app with the same permissions ran on the
win2k3 server just fine.
I appreciate ANY help or guidance anyone has to offer about this problem and
thank you in advance for your time,
Ed
| |
| David Wang [Msft] 2005-06-29, 5:53 pm |
| Several problems with what you have already tried:
1. To make w3wp.exe (and any process it launches) show up on the desktop,
you just need to set W3SVC to Interact with desktop and restart W3SVC
service. Subsequently, you can attach debuggers to w3wp.exe so it shows up
on screen by default, and so do other EXEs that you launch from it (for
example, I can launch notepad.exe from a web app run by IIS and have it show
up on screen).
2. IIS6 does not have any security policy nor such issues. It just runs code
with the users and privileges that are either assigned by default or
user-defined, so IIS6 doesn't have a policy or configuration that says "make
your situation fail".
3. If you can make the same piece of code run on the same machine from the
console but not from IIS, then it is likely due to differences in the user
logon performed by IIS and WINLOGON (what you use to login to the console).
The logon affect privileges on the user token, which may affect other
privileges for API calls *regardless* of file system ACLs (this is yet
another reason why you are going about this backwards).
The first thing I would do is contact support for your third party library
regarding their support of IIS6. My suspicion is that their code is relying
on some privilege to work, and they need to tell you what it is instead of
you guessing and trying to figure out what permissions their code needs.
My suspicion is that bzcmd.exe spawns, hits an error with *something*, and
just sits there forever. So, w3wp.exe cannot communicate with it. Obtaining
support for bzcmd.exe is where I would start.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Ed" <Ed@discussions.microsoft.com> wrote in message
news:A0B6E2AF-99C2-4BB0-86C9-7030F8369011@microsoft.com...
I have an interesting problem that I believe has to do with some IIS 6
settings that I am not aware of and I have just about exhausted searching
google and this discussion group. Hopefully, someone here can shed some
light on the issue I am having.
Anyway, in my .NET web application, I am using a third party class library
(bzwhll.dll) to communicate with a backend IBM z800 host system. This
library spawns a process (bzmd.exe) and interacts with it to read and write
to mainframe host screens using a combnation of DDE, telnet and winHLLAPI.
I
developed the web app on a winXP system with IIS5 installed. On this
development system, the app works just fine. When I moved the app to our
win2k3/IIS6 development server, however, the web app did not work properly.
The bzmd.exe process is spawned just fine (I can see it running as NETWORK
SERVICE in the task manager) but it doesn't seem like the w3wp.exe process
can interact with the bzmd.exe process once that process is started (it
doesn't even kill the process after the script has finished running even
though it did on the winXP/IIS5 system and the code calls those commands).
When I run the script, there are no messages in the Event logs to indicate
any error nor are there any exceptions thrown in the code. ASP.NET is
installed correctly on the server and is working fine.
Some things I have already tried:
-I've tried running the w3wp.exe process as my user account (which is an
administrator), and running the iis admin and w3 publishing services as my
user with "interact with desktop" checked. One thing that I noticed in this
situation was that, when remote desktoped into this machine and running this
test script, the bzmd.exe processes were running under my user account but
did not show up as an active window on the desktop (I guess this is because
IIS6 runs processes in it's own isolated space?).
-I've also given "Everyone" full permissions to the entire C: drive with
the same problem, so I don't think it's a folder/file permission issue.
Maybe a security policy issue in IIS6?
To make matters even worse, I wrote a small .NET console app that uses the
SAME exact classes libraries and code as the webapp (which I then ran under
the same admin account that I ran the webapp as), that connected to the
mainframe and ran fine. I am at wits end here about this solution, which
works fine on another machine running winXP/IIS5 but not on this win2k3/IIS6
machine, even though the console app with the same permissions ran on the
win2k3 server just fine.
I appreciate ANY help or guidance anyone has to offer about this problem and
thank you in advance for your time,
Ed
| |
| Jordan 2005-07-27, 7:51 am |
| David -
I'm simply trying to launch calc.exe on the Web Server (and see it's
window) from a .aspx page.
I have set the IIS Admin Service and W3SVC Service Logon settings to
"Interact with desktop", and have restarted those services.
I have also followed the directions from:
http://support.microsoft.com/defaul...kb;en-us;555134
However, calc.exe remains in the background!!!
Below is my Code, what can I do to make calc.exe or notepad.exe
visible?? I see it running as Network Service in the Task Manager...
(I'm running W2k3 Server SP1)
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Runtime.InteropServices" %>
<HTML>
<Head>
<script runat=server>
public int runCommand()
{
try
{
System.Diagnostics.Process myprocess = new
System.Diagnostics.Process();
myprocess.StartInfo.CreateNoWindow = false;
myprocess.StartInfo.FileName = "calc.exe";
myprocess.Start();
return 1;
}
catch(Exception ex)
{
return 0;
}
}
</script>
</Head>
<BODY>
<%=runCommand().ToString()%>
</BODY>
</HTML>
|
|
|
|
|