ThinkGeo.com    |     Documentation    |     Premium Support

Random ArgumentException

Hello,


Some times, while navigating, an ArgumentException is thrown. I cannot really says where it comes from, decause it seems to be in the control itself, and I don't understand what I do wrong.


If you help me how to investigate for this problem to know where it comes exactly from, I will send you more informations, but now I can only send you the following stacktrace :


System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: Ungültiger Parameter.




   bei System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)

   bei System.Drawing.Bitmap..ctor(Int32 width, Int32 height)

   bei ThinkGeo.MapSuite.DesktopEdition.WpfMap.xfbd15a0e9d15f4e2(Graphics x783a718028818269, RectangleShape xb35a33b423b17f65)

   bei ThinkGeo.MapSuite.DesktopEdition.WpfMap.x7d52d0ad1d6779cd(Boolean x991dc8ddc7528b44, RectangleShape x178b193eec228e6e)

   --- Ende der internen Ausnahmestapelüberwachung ---

   bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

   bei System.Delegate.DynamicInvokeImpl(Object[] args)

   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)

   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

 


I'm using the WpfClient, that consumes a Wms Server, and displays geometries in an inMemoryLayer.


Do you have some advice for me ?

Many thanks,

Guillaume.



Hello again. 
  
 I forgot to say that I can reproduce this problem, but some time an OutOfMemoryException is thrown instead of this ArgumentException. 
  
 Here is the StackTrace for the OutOfMemoryException : 
  
 System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. —> System.OutOfMemoryException: Nicht genügend Arbeitsspeicher. 
    bei System.Drawing.Graphics.CheckErrorStatus(Int32 status) 
    bei System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y) 
    bei System.Drawing.Graphics.DrawImageUnscaled(Image image, Int32 x, Int32 y) 
    bei ThinkGeo.MapSuite.DesktopEdition.WpfMap.xe6f5d5d0c25c9bd5(Graphics x783a718028818269, RectangleShape xb35a33b423b17f65, Overlay x99251f66cdabc2ad) 
    bei ThinkGeo.MapSuite.DesktopEdition.WpfMap.x7d52d0ad1d6779cd(Boolean x991dc8ddc7528b44, RectangleShape x178b193eec228e6e) 
    — Ende der internen Ausnahmestapelüberwachung — 
    bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
    bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 
    bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) 
    bei System.Delegate.DynamicInvokeImpl(Object[] args) 
    bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
    bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 


Guillaume, 
  
 Thanks for your reply,  
  
 I found out the function where it caused the exception, but I really can’t reproduce the OutOfMemory exception in this function, I guessed maybe the problem is from your sample code or data, can you give me a sample to reproduce the problem so that we can trouble shoot on it exactly. 
  
 Thanks, 
  
 Scott,

Scott, 
  
 Thanks for your reply. 
  
 I tried to reproduce this problem in a small sample, but I did’nt manage to reproduce it. 
 However I can easily reproduce it in our application. 
  
 I’ll send you a reply as soon as I’ll have reproduced it in an easy sample. 
 Guillaume.

Guillaume, 
  
 Maybe it is difficult to recrete that OutOfMemoryException without loading a large image, if you can recreate the issue that by loading some relative small image the memory rise up rapidly (even does not throw that exception), that’s also very helpful for us to locate the problem. Also could you let me know what does “Ein Aufrufziel hat einen Ausnahmefehler verursacht” mean in English, and let me know what type of image and which version of Map Suite you are using? 
  
 Thanks, 
  
 Ben 


Hello Ben, 
  
 Sorry for forgotten the translation ! 
 In English this message means : “Exception has been thrown by the target of an invocation” 
  
 I’m using MapSuite 3.1.299, and I am loading png images from a Wms Server. 
  
 Thanks, 
 Guillaume. 


Guillaume, 
  
 I see. I’m not sure the reason for that as getting an image from WMS server should not take too much memory. Looking forward your simple sample to recreate it. 
  
 Thanks, 
  
 ben