Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / July 2004

Tip: Looking for answers? Try searching our database.

disappearing process when launched from web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Mackey - 28 Jul 2004 11:15 GMT
Hi,
I have a question about the scope of a process, when launched from a web service (using Process.Start).  it may sound silly but there is an unusual side effect, the process disappears as soon as it starts.  i'm building a very simple web service to control a server dial-up connection, as follows:

[WebMethod]
public void Dial()
{
  Process.Start("rasdial.exe", "utv_isdn user pass");
}

this works when i invoke it, but the connection is disconnected straight away.  (if i run it from cmd.exe, it works fine).  it's as if the process gets cleaned up as soon as the web request is finished, is this an IIS thing to do with processes created by a web request? if it was a variable going out of scope as soon as the request was done then i could understand this behaviour, but Process.Start is supposed to start a system process and leave it until it finishes or the code calls Abort process.

thanks for any help
tim

\\ email: tim at mackey dot ie //
\\ blog: http://tim.mackey.ie //
67d0ebfec70e8db3
Frank - 29 Jul 2004 01:36 GMT
I don't think my last post came through, so I apologize if this post shows
up twice:

Perhaps its a security issue. Is your web service app running as a Windows
Service? If so, your app will not be able to launch another process that has
any UI (console or graphical) unless your service has the "Allow service to
interact with desktop" flag set.

If that's not it, just for experimentation purposes, try filling out a
ProcessStartInfo struct with the UseShellExecute property set to true.

Regards,
Frank

-----
Hi,
I have a question about the scope of a process, when launched from a web
service (using Process.Start).  it may sound silly but there is an unusual
side effect, the process disappears as soon as it starts.  i'm building a
very simple web service to control a server dial-up connection, as follows:

[WebMethod]
public void Dial()
{
  Process.Start("rasdial.exe", "utv_isdn user pass");
}

this works when i invoke it, but the connection is disconnected straight
away.  (if i run it from cmd.exe, it works fine).  it's as if the process
gets cleaned up as soon as the web request is finished, is this an IIS thing
to do with processes created by a web request? if it was a variable going
out of scope as soon as the request was done then i could understand this
behaviour, but Process.Start is supposed to start a system process and leave
it until it finishes or the code calls Abort process.

thanks for any help
tim

\\ email: tim at mackey dot ie //
\\ blog: http://tim.mackey.ie //
67d0ebfec70e8db3
Tim Mackey - 29 Jul 2004 11:35 GMT
hi Frank,
many thanks for your reply. i had it running as a normal web service, not a
windows service, but now i know about that "interact with desktop" option :)

the UseShellExecute didn't make any difference but it was worth a try.

i actually got it working by changing the appPool for the virtual directory
(running the web service) to a new AppPool i made which runs with the local
system identity.

if anyone is interested in how i got the app working,  i put the VS solution
on my blog:
http://tim.mackey.ie/PermaLink.aspx?guid=a5a567a6-4d00-48f1-9b09-2fe2046eeced

thanks
tim

\\ email: tim at mackey dot ie // \\ blog: http://tim.mackey.ie //
67d0ebfec70e8db3
> I don't think my last post came through, so I apologize if this post shows
> up twice:
[quoted text clipped - 37 lines]
> \\ blog: http://tim.mackey.ie //
> 67d0ebfec70e8db3

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.