Monday, August 01, 2005

call external exe from asp.net

looks like a simple task, huh?

I have two applications, one is win app and the other is web app. I had no trouble to call a external PVCS command from win app, but I had HUGE trouble to do the same thing in my web app.

Rationale:
(1). PVCS commond need use windows authentication to establish connection to PVCS server
(2). .Net web application use a weak machine name to run Aspnet_wp.exe
(3). when external command is envoked from web app, it will use that weak name
(4). using impersonate won't help, cause impersonate only apply to web app itself, not external apps

Solution:
(1). change processmodel section in the machine.config, using windows' logon domain/username and its password

drawback:
(1) all web application running in this machine will use your window username and password, because you changed the machine.config

possible alternative
(1). using win32 API "CreateProcessWithLogonW"
or
(2). change configuration in PVCS so that it can take the default weak name of aspnet

still puzzled:
(1). where do I see who's in the owner of a process in windows task manager?

reference:
link

No comments: