Sporadic ObjectDisposedException since migrating to .Net CF 3.9

We experience sporadic ObjectDisposedExceptions on our VF61. The Application has been migrated from a PXA270 without other changes than Screen Size.

Stacktrace:

ObjectDisposedException Stacktace:    at System.Threading.EventWaitHandle.Set()
    at System.Windows.Forms.Control.TASK.MarkDone()  
    at System.Windows.Forms.Control.TASK.Invoke()  
    at System.Windows.Forms.Control._InvokeAll()  
    at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)  
    at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)  
    at System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)  
    at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)  
    at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)  
    at System.Windows.Forms.Application.Run(Form fm)  
    at KwsGui.Program.Main()  

I have tried to catch the Exception but without luck.
The Application is running 24/7.
The error appears somewhere between once a week and once a Year. Thus it is very hard to reproduce. It does happen without interaction of a User.
We have never seen the Problem on the old PXA270! It is almost certainly a Problem that we got from switching to the newer .Net CF or the new OS.
We started seeing this on the Image V1.5 (first Image we used on VF61) and still see it on Image V1.7.
The Application has multiple Threads. It is the GUI Thread that crashes. The Background Threads seem to continue to work until the error message is acknowledged.
Unfortunately I cannot provide a small Program to show the Error since we obviously don’t know what triggers the fault.

It sounds a bit like this: https://social.msdn.microsoft.com/Forums/en-US/04b01b0e-597b-4221-a572-200a0b6b5653/objectdisposedexception-from-controltaskmarkdone?forum=netfxcompact
But following the hints in that Thread did not lead us to a Solution.
I already checked all Invokes and Timers twice.

Could you please try an updated version of .Net CF 3.9 ?

Wow after 11 Months finally an answer…

The error is very sporadic, thus we cannot just setup a testmachine and wait a couple days to see if that is better or not. The median time to failure in one machine is 4-6 months. The error was so critical for us because of the amount of machines that we put out there.

Meanwhile we have created a workaround for the bug which seems to work. We have removed all thread changes. The GUI and the internal logics are now communicating via shared memory protected with semaphores.

Short: No I cannot test that in any sufficient way.

Can you share an updated link? This is not available anymore! Is there really a new version since 2016?

YOU can download it here. It includes updates up to Apr 2019

1 Like

@alex.tx
Last question (sorry for that): Is it possible to update an allready installed .netcf39 (your version 1.1) with that cap installer, just by executing it again? Or is it better to install it on a clean image from you?
Thank a lot in advance!

Should be enough to just run it again, But we didn’t test this scenario.

1 Like