Wyjątek TargetInvocation: Microsoft.AGL.Common.MISC.HandleAr (PAL_ERROR ar)

Losowo dostaję TargetInvocationException podczas ładowania zasobów w projekcie .NET Compact Framework 3.5 (działającym na Windows Mobile 6). Wyglądają podobnie do tego śladu stosu:

FATAL 2012-11-13 14:17:00,657 [23768895] TargetInvocationException - mobileX.MIP.Post.Presentation.Program
System.Reflection.TargetInvocationException: TargetInvocationException ---> System.Exception: Exception
at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
at System.Drawing.Bitmap._InitFromMemoryStream(MemoryStream mstream)
at System.Drawing.Bitmap..ctor(Stream stream)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at System.Resources.ResourceReader.CreateResource(Type objType, Type[] ctorParamTypes, Object[] ctorParameters)
at System.Resources.ResourceReader.LoadBitmap(Int32 typeIndex)
at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture)

Domyślam się, że powodem tego wyjątku jest to, że jest jakiś niezarządzany zasób, którego zapomniałem wyczyścić. Jednak w projekcie mam dużo formularzy i zasobów.

Oto moje pytania:

Czy formularz lub zasób, który nie został wyczyszczony, może być powodem tego wyjątku?Jak mogę prześledzić dokładną formę lub zasób, który marnuje moją pamięć?

Odnośnie 2: już profilowałem moją aplikację za pomocą CLR Profiler z.NET Compact Framework Power Toys 3.5. Dużo pamięci to „NATIVE FUNCTION” /System.Windows.Forms.Control::_InternalWnProc Microsoft.AGL.Common.PAL_ERROR (Microsoft.AGL.Forms.WM int32 int32). Nie widzę jednak, gdzie te zasoby są wykorzystywane. Jak mogę się dowiedzieć?

questionAnswers(1)

yourAnswerToTheQuestion