We are currently on WPF Desktop 5.0, and are hitting an issue whenever our application is run on .NET 4.5 or Windows 8. I am not even sure entirely when this error is thrown because the stack trace is so difficult to discern and it is coming from a thread.
Here is the stack trace:
Parameter is not valid.
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.DrawException(GeoCanvas geoCanvas, Exception exception)
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.Draw(GeoCanvas geoCanvas)
at ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay.DrawTileCore(Tile tile, RectangleShape targetExtent)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.DrawTile(Tile tile, RectangleShape targetExtent)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.vhQ=(RectangleShape vxQ=)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.DrawCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay.DrawCore(RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.Overlay.Draw(RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.WhU=(Overlay XRU=, RectangleShape XhU=, OverlayRefreshType XxU=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.UhU=(IEnumerable`1 VxU=, RectangleShape WBU=, OverlayRefreshType WRU=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.UhU=(RectangleShape UxU=, OverlayRefreshType VBU=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.DrawCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.Draw(RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.QhU=(RectangleShape QxU=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.ShU=(Object SxU=, EventArgs TBU=)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at BSAForms.Dialog.Common.ProgressDialog.ProgressCompleted(Boolean cancelled, Exception error, Object result)
at BSAForms.Dialog.Common.ProgressDialog.BackgroundWorker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.RunWorkerCompletedEventHandler.Invoke(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
Any thoughts on what could be causing this? We are in the process of moving to 7.0 but it has it’s own suite of issues so in the mean time I’m trying to resolve this exception.
"Parameter is not valid" Exception in .NET 4.5
Hi Kevin,
Thanks for your post, but I am sorry to say that this exception is a very generic problem, it is a little hard to recreate on our end, if possible, would you please provide us a small "self-contained" sample to recreate it? Meanwhile, if possible, to move to 7.0 and try it again could be a prior choice.
Waiting for your further information.
Best Regards
Summer