I have an assembly in which, upon access, a single thread is created to process the elements placed in the queue. In this assembly, I attach a DomainUnload event handler:
AppDomain.CurrentDomain.DomainUnload += new EventHandler(CurrentDomain_DomainUnload);
This handler attaches the thread to the main thread so that all elements in the queue can complete processing before the application expires.
The problem I encountered is that the DomainUnload event does not fire when the console application terminates. Any ideas why this would be?
Using .NET 3.5 and C #
source share