PC Review


Reply
Thread Tools Rate Thread

AppDomain.ProcessExit event not fired in Internet Explorer

 
 
Olivier R
Guest
Posts: n/a
 
      21st Jan 2004
Hello,

My configuration :
Windows XP
Internet Explorer 6
..NET Framework 1.0
Visual Studio .NET 2002


The symptoms:
I have created a class which registers a handler for the
AppDomain.ProcessExit event (say this is done in a static method Class.Init()).

Case 1:
Class hosted in a Windows Application :
The handler is called when I close the Windows Application.

Case 2:
Class hosted in Internet Explorer :
The handler is not called when I close Internet Explorer !!
(I obviously checked that Class.Init() had been called).

Can someone help me ??
Thanks !
 
Reply With Quote
 
 
 
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      21st Jan 2004
Hello,

I think it's because the process itself (in this case the iexplore.exe that
hosts the CLR) does not actually exit.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Olivier R" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> My configuration :
> Windows XP
> Internet Explorer 6
> .NET Framework 1.0
> Visual Studio .NET 2002
>
>
> The symptoms:
> I have created a class which registers a handler for the
> AppDomain.ProcessExit event (say this is done in a static method

Class.Init()).
>
> Case 1:
> Class hosted in a Windows Application :
> The handler is called when I close the Windows Application.
>
> Case 2:
> Class hosted in Internet Explorer :
> The handler is not called when I close Internet Explorer !!
> (I obviously checked that Class.Init() had been called).
>
> Can someone help me ??
> Thanks !


 
Reply With Quote
 
Olivier R
Guest
Posts: n/a
 
      21st Jan 2004
I don't agree with you.
I checked that the internet explorer process instance exits since
it disappears from the list of the tasks in the task manager or there
is something wrong with my eyes ?

"Dmitriy Lapshin [C# / .NET MVP]" <x-(E-Mail Removed)> wrote in message news:<O0wSu6$(E-Mail Removed)>...
> Hello,
>
> I think it's because the process itself (in this case the iexplore.exe that
> hosts the CLR) does not actually exit.
>
> --
> Dmitriy Lapshin [C# / .NET MVP]
> X-Unity Test Studio
> http://x-unity.miik.com.ua/teststudio.aspx
> Bring the power of unit testing to VS .NET IDE
>
> "Olivier R" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> >
> > My configuration :
> > Windows XP
> > Internet Explorer 6
> > .NET Framework 1.0
> > Visual Studio .NET 2002
> >
> >
> > The symptoms:
> > I have created a class which registers a handler for the
> > AppDomain.ProcessExit event (say this is done in a static method

> Class.Init()).
> >
> > Case 1:
> > Class hosted in a Windows Application :
> > The handler is called when I close the Windows Application.
> >
> > Case 2:
> > Class hosted in Internet Explorer :
> > The handler is not called when I close Internet Explorer !!
> > (I obviously checked that Class.Init() had been called).
> >
> > Can someone help me ??
> > Thanks !

 
Reply With Quote
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      22nd Jan 2004
Does it disappear from the list of the tasks or from the list of processes?
This difference is important. If it disappears from the list of processes,
then my only suggestion would be that the AppDomain is not given a chance to
uninitialize properly and therefore it cannot raise the event in question.

Another guess after reading the corresponding MSDN topic - security
permissions (CLR hosted in IE runs managed code with rather tight security
restrictions) can affect raising this event. This seems strange to me, as
you wouldn't then be able to subscribe to that event in the first place.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Olivier R" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I don't agree with you.
> I checked that the internet explorer process instance exits since
> it disappears from the list of the tasks in the task manager or there
> is something wrong with my eyes ?
>
> "Dmitriy Lapshin [C# / .NET MVP]" <x-(E-Mail Removed)> wrote

in message news:<O0wSu6$(E-Mail Removed)>...
> > Hello,
> >
> > I think it's because the process itself (in this case the iexplore.exe

that
> > hosts the CLR) does not actually exit.
> >
> > --
> > Dmitriy Lapshin [C# / .NET MVP]
> > X-Unity Test Studio
> > http://x-unity.miik.com.ua/teststudio.aspx
> > Bring the power of unit testing to VS .NET IDE
> >
> > "Olivier R" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello,
> > >
> > > My configuration :
> > > Windows XP
> > > Internet Explorer 6
> > > .NET Framework 1.0
> > > Visual Studio .NET 2002
> > >
> > >
> > > The symptoms:
> > > I have created a class which registers a handler for the
> > > AppDomain.ProcessExit event (say this is done in a static method

> > Class.Init()).
> > >
> > > Case 1:
> > > Class hosted in a Windows Application :
> > > The handler is called when I close the Windows Application.
> > >
> > > Case 2:
> > > Class hosted in Internet Explorer :
> > > The handler is not called when I close Internet Explorer !!
> > > (I obviously checked that Class.Init() had been called).
> > >
> > > Can someone help me ??
> > > Thanks !


 
Reply With Quote
 
Olivier R
Guest
Posts: n/a
 
      22nd Jan 2004
"Dmitriy Lapshin [C# / .NET MVP]" <x-(E-Mail Removed)> wrote in message news:<ORct$(E-Mail Removed)>...
> Does it disappear from the list of the tasks or from the list of processes?

Excuse me, I hadn't been clear enough.
The IEXPLORE.EXE process disappears from the list of processes.

> This difference is important. If it disappears from the list of processes,
> then my only suggestion would be that the AppDomain is not given a chance to
> uninitialize properly and therefore it cannot raise the event in question.
>

I agree with you on this potential cause.

> Another guess after reading the corresponding MSDN topic - security
> permissions (CLR hosted in IE runs managed code with rather tight security
> restrictions) can affect raising this event. This seems strange to me, as
> you wouldn't then be able to subscribe to that event in the first place.
>

I forgot to mention that I'm logged as local administrator and that I
enabled
full code access for my assembly on my local machine.

Another interesting thing is that I can register
an UnhandledExceptionEventHandler without any exception being thrown.
However, my routine is not called when an unhandled exception is
thrown.
Instead, this is the CLR routine that is called.
The event is not fired.
This leads me to think that in this case, the event registration
REALLY failed !
But I expected that after my reading on an excellent article on MSDN :
"Return of the Rich client".


> --
> Dmitriy Lapshin [C# / .NET MVP]
> X-Unity Test Studio
> http://x-unity.miik.com.ua/teststudio.aspx
> Bring the power of unit testing to VS .NET IDE
>
> "Olivier R" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I don't agree with you.
> > I checked that the internet explorer process instance exits since
> > it disappears from the list of the tasks in the task manager or there
> > is something wrong with my eyes ?
> >
> > "Dmitriy Lapshin [C# / .NET MVP]" <x-(E-Mail Removed)> wrote

> in message news:<O0wSu6$(E-Mail Removed)>...
> > > Hello,
> > >
> > > I think it's because the process itself (in this case the iexplore.exe

> that
> > > hosts the CLR) does not actually exit.
> > >
> > > --
> > > Dmitriy Lapshin [C# / .NET MVP]
> > > X-Unity Test Studio
> > > http://x-unity.miik.com.ua/teststudio.aspx
> > > Bring the power of unit testing to VS .NET IDE
> > >
> > > "Olivier R" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Hello,
> > > >
> > > > My configuration :
> > > > Windows XP
> > > > Internet Explorer 6
> > > > .NET Framework 1.0
> > > > Visual Studio .NET 2002
> > > >
> > > >
> > > > The symptoms:
> > > > I have created a class which registers a handler for the
> > > > AppDomain.ProcessExit event (say this is done in a static method

> Class.Init()).
> > > >
> > > > Case 1:
> > > > Class hosted in a Windows Application :
> > > > The handler is called when I close the Windows Application.
> > > >
> > > > Case 2:
> > > > Class hosted in Internet Explorer :
> > > > The handler is not called when I close Internet Explorer !!
> > > > (I obviously checked that Class.Init() had been called).
> > > >
> > > > Can someone help me ??
> > > > Thanks !

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event object is null when event is fired. WebUserControl ASP.NET/AJAX Matt Michler Microsoft C# .NET 0 28th Aug 2007 09:53 PM
Explorer' Close event not fired j Microsoft Outlook Program Addins 9 2nd Apr 2007 02:24 PM
Calling Web Service in DragDrop event causes event to be fired multipletimes Vincent Mouton Microsoft Dot NET Framework Forms 0 18th Mar 2005 07:28 PM
Repost: Isolation In AppDomain - How to prevent the main AppDomain to crash when another AppDomain Crashes?????? José Joye Microsoft C# .NET 7 6th Nov 2003 02:10 PM
Repost: Isolation In AppDomain - How to prevent the main AppDomain to crash when another AppDomain Crashes?????? José Joye Microsoft Dot NET 7 6th Nov 2003 02:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 PM.