D
Dilip
I have a problem thats been driving me crazy all day.
I have an application that quietly runs in the background. This
application can only be shutdown externally as it displays no UI. So
I made this application create a named EventWaitHandle and performed a
WaitOne() on it.
From the external application I do an EventWaitHandle.OpenExisting,
passing the appropriate name and do a Set() on it which ensures that
the former application shuts down just fine.
Now I have an ASP.NET application that wants to know if the invisible
application is currently running or not. So like the external
application I do another EventWaitHandle.OpenExisting. For some
unfathomable reason this call *always* throws a
WaitHandleCannotBeOpenedException! I meant this is driving me batty.
I know that the invisible application is running and the EWH has been
successfully created (because the external application is able to open
the event and shut it down just fine). Why does the ASP.NET app throw
an exception?
First I thought might be a security issue, so I used
EventWaitHandleSecurity and EventWaitHandleAccessRule classes to grant
FULL access to the logged on user and the NETWORK SERVICE (under which
my ASP.NET app runs) accounts while creating the EventWaitHandle.
That still doesn't work.
What am I doing wrong?
I have an application that quietly runs in the background. This
application can only be shutdown externally as it displays no UI. So
I made this application create a named EventWaitHandle and performed a
WaitOne() on it.
From the external application I do an EventWaitHandle.OpenExisting,
passing the appropriate name and do a Set() on it which ensures that
the former application shuts down just fine.
Now I have an ASP.NET application that wants to know if the invisible
application is currently running or not. So like the external
application I do another EventWaitHandle.OpenExisting. For some
unfathomable reason this call *always* throws a
WaitHandleCannotBeOpenedException! I meant this is driving me batty.
I know that the invisible application is running and the EWH has been
successfully created (because the external application is able to open
the event and shut it down just fine). Why does the ASP.NET app throw
an exception?
First I thought might be a security issue, so I used
EventWaitHandleSecurity and EventWaitHandleAccessRule classes to grant
FULL access to the logged on user and the NETWORK SERVICE (under which
my ASP.NET app runs) accounts while creating the EventWaitHandle.
That still doesn't work.
What am I doing wrong?