c# - ProcessExit vs DomainUnload -


I am working on a bug where the code does not always execute before the application closes. The code was in a handler for the AppDomain.CurrentDomain.DomainUnload event.

I got a post from someone with the same problem getting this advice

"The domain U-load event is for your default app domain, executed by your code What you can do with the processed event on the default appdomain. "

This works for me, but I would like to know why I am either of these events or between the two More on the differences of G I could not find. I am also thinking that I need to subscribe to both or process is sufficient.

EDIT:

I want to add more information to make it a little more useful.

I came to know that the new threads were being created in their own AppDomain because I had to run this code not only when the original process was done, but whenever every thread ended, To handle the event at the end of the unit, it is necessary to subscribe to the DomainUnload event and to catch the ProcessExit event even when the original process is finished.

processEX should be sufficient.

Domain Download The event is designed to be controlled by other app docs, and not AppDomain is being unloaded. As a result, if the handler is being added to the domain, then it can not run. Process Exit is designed to run the event when the process is going to exit


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -