Re: Relationship between Application.Exit() and AppDomain



Hi Sunny,

Sorry for the late response to you, I am out of office yesterday. Anyway, I
am glad Willy has provided a great and informative discussion with you.

I assume your application is coded in Winform since you are using
System.Winforms.Forms.Application. So, your application created a seperate
AppDomain to host the 3rd party code for security/robustness reason ? Can
you tell us if the 3rd party code is also GUI code? This design and
achitecture looks strange to me, since I did not see any programs using this
design. We normally run the semi-trusted non-GUI addin in the separate
AppDomain.

I ask these because Application.Exit can only be used in GUI Winform code
not normal non-GUI code. Also, it can only shut down the GUI threads in the
*Application*. If the 3rd party code created a few more worker(non-GUI)
threads, they will be cleaned by Application.Exit. As Willy originally
pointed out, Application.Exit() has nothing to do with AppDomain, so it will
not help to clearn AppDomain. Why don't you call AppDomain.Unload method to
get rid of the buggy 3rd party code?

Regarding your last question, I think Reflector should be the best tool to
understand the .Net BCL internal work. What internal call functions do you
have problem to understand? As I know Winform purely encapsulates the Win32
GUI code, so I assume most of the non-.Net code is p/invoking the Win32
User32 APIs. The Win32 GUI programming books(such as <Programming Windows>)
should be good resource to help you understand GUI APIs.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages

  • Re: Relationship between Application.Exit() and AppDomain
    ... Yes, the app we are writing is being coded in Winform, it's not a Web ... trying to create an app that would host some other applications, either GUI ... AppDomain to host the 3rd party code for security/robustness reason? ...
    (microsoft.public.dotnet.framework.clr)
  • Re: 16-bit will nicht mehr?
    ... > konsolen Basis (ohne GUI) und eine als Winform. ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.german.windows.server.general)
  • Re: Problem bei gegenseitiges Aufrufen von Funktion über AppDomaingrenzen hinweg
    ... Nun möchte ich das durch Plugins erweitern. ... Deshalb wollte ich das ganze auch auf die GUI erweitern. ... Die GUI sagt als dem Loader(irgendwas muss ja die AppDomain laden uund die ... FileSystemwatcher von meinem Loader aus auf des Verzeichnis mit der GUI ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • RE: Run WinForms app as Console app
    ... This has nothing to do with the WinForm application. ... To wait before a GUI ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Systemweites Event auslösen
    ... und unter .NET wohl nur in derselben AppDomain nutzbar. ... nicht zwingend ein 'visuelles GUI', ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.german.entwickler.dotnet.vb)