Mega Code Archive

 
Categories / C# Tutorial / Development
 

Is AppDomain Finalizing For Unload(), Environment HasShutdownStarted

using System; using System.Runtime.InteropServices; using System.Diagnostics; public sealed class MainClass {     static void Main()     {          AppDomain currentDomain = AppDomain.CurrentDomain;          if( !currentDomain.IsFinalizingForUnload() &&!Environment.HasShutdownStarted ) {             Console.WriteLine( "Failed to dispose of object!!!" );             Console.WriteLine( "Object allocated at:" );          }     } } Failed to dispose of object!!! Object allocated at: