miercuri, 25 aprilie 2012

WindowsFormsHost control leaks memory after dispose | Microsoft Connect

WindowsFormsHost control leaks memory after dispose | Microsoft Connect: "A WindowsFormsHost control that has been displayed on screen and has created its ActivateWindowListener property will not be collected by the GC after it has been removed from the form and disposed."

'via Blog this'

miercuri, 11 aprilie 2012

System.Collections.Generic.Dictionary and Possible Exceptions

static void Main(string[] i_args)
{
    Dictionary<string, string> _names = new Dictionary<string, string>
                                            {{"Iliescu", "Ion"}, {"Basescu", "Traian"}
                                            , {null, "Dorel"}}; //ArgumentNullException
    Console.WriteLine(_names[null]); // ArgumentNullException
    Console.WriteLine(_names["Geoana"]); //KeyNotFoundException
}

marți, 10 aprilie 2012

ExecutionEngineException


The exception that is thrown when there is an internal error in the execution engine of the common language runtime. This class cannot be inherited. (http://msdn.microsoft.com/en-us/library/system.executionengineexception.aspx)


Causes: 
- The application or the system on which it is running is under a heavy load 
- Concurrent garbage collection is not supported in applications running the WOW64 x86 emulator on 64-bit systems that implement the Intel Itanium architecture (formerly called IA-64). (http://msdn.microsoft.com/en-us/library/at1stbec.aspx)
- DEVPATH environment variable has been set (http://blogs.msdn.com/b/suzcook/archive/2003/08/15/57238.aspx, http://weblogs.asp.net/tgraham/archive/2004/06/07/150225.aspx)
- memory corruption in unmanaged code or in the interop with unmanaged code (http://k-mug.org/forums/p/816/2632.aspx)
- serialization throws ExecutionEngineException (http://forums.silverlight.net/t/86739.aspx/1)




Other info:
- Known issue for .NET 1.1: (http://support.microsoft.com/kb/827210/) 
"If you create a new application domain, and you use the Activator class to create a proxy for an object, you may receive the following exception error message from the application: System.ExecutionEngineException occurred in an unkonwn module"
http://support.microsoft.com/kb/330900:
"When you use Microsoft .NET COM Interop, and COM interfaces are being marshaled, a typical exception that occurs when the code runs might cause the marshaled interface to be prematurely cleaned up. If this occurs, when you try to use the interface later, the .NET runtime throws an ExecutionEngineException error."