applicationdomain

Why does calling AppDomain.Unload doesn't result in a garbage collection?

冷暖自知 提交于 2019-12-03 18:28:26
问题 When I perform a AppDomain.Unload(myDomain) I expect it to also do a full garbage collection. According to Jeffrey Richter in "CLR via C#" he says that during an AppDomain.Unload: The CLR forces a garbage collection to occur, reclaiming the memory used by any objects that were created by the now unloaded AppDomain. The Finalize methods for these objects are called, giving the objects a chance to clean themselves up properly. According to "Steven Pratschner" in "Customizing .NET Framework

What is the scope of a Static Class?

a 夏天 提交于 2019-11-28 21:24:54
I have an assembly that may be used by more than one process at a time. If I am using a static class, would the multiple processes all use the same "instance" of that class? Since the processes are separate, would these be running under difference Application Domains, hence have the static "instances" separate? The pudding in the details here is that the assembly is being used by a custom BizTalk adapter that my be set to process the messages in parallel batches. That is what I am calling "multiple processes" above. Multiple threads would share an instance. For this reason a static class can

What is the scope of a Static Class?

烂漫一生 提交于 2019-11-27 13:48:45
问题 I have an assembly that may be used by more than one process at a time. If I am using a static class, would the multiple processes all use the same "instance" of that class? Since the processes are separate, would these be running under difference Application Domains, hence have the static "instances" separate? The pudding in the details here is that the assembly is being used by a custom BizTalk adapter that my be set to process the messages in parallel batches. That is what I am calling