Page 1 of 1

System.Threading.ThreadAbortException

Posted: Tue Apr 11, 2017 4:24 pm
by brauchlik
We are experiencing some strange Threading Exceptions with recent versions of the TWAIN library (Version 10).

These exceptions occur, when there is no scanner attached but we open the DeviceManager in order to query for available scanners.

Here is the Log from the Twain Library.

11.04.2017 15:18:19 73,256,960 Debugging enabled [10.1.5.3]
11.04.2017 15:18:27 78,843,904 Device manager is opening PathToDSM=C:\windows\TWAIN_32.DLL
11.04.2017 15:18:27 78,983,168 DeviceManagerStateChanged Closed => Loaded
11.04.2017 15:18:27 79,220,736 DeviceManagerStateChanged Loaded => Opened
11.04.2017 15:18:27 79,220,736 Device manager is opened
11.04.2017 15:18:27 79,724,544 Device manager is closing
11.04.2017 15:18:27 79,724,544 DeviceManagerStateChanged Opened => Loaded
11.04.2017 15:18:27 79,618,048 DeviceManagerStateChanged Loaded => Closed
11.04.2017 15:18:27 79,732,736 Device manager is closed
11.04.2017 15:18:27 79,683,584 Device manager is opening PathToDSM=C:\windows\TWAIN_32.DLL
11.04.2017 15:18:27 79,822,848 DeviceManagerStateChanged Closed => Loaded
11.04.2017 15:18:27 80,019,456 DeviceManagerStateChanged Loaded => Opened
11.04.2017 15:18:27 80,019,456 Device manager is opened
11.04.2017 15:18:31 84,209,664 Unhandled exception: Type=System.Threading.ThreadAbortException, Message=Der Thread wurde abgebrochen., StackTrace= bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
bei Vintasoft.Twain.DeviceManager.ᜀ(Object A_0)
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart(Object obj), IsTerminating=False
11.04.2017 15:18:34 84,971,520 Device manager is closing
11.04.2017 15:18:34 84,983,808 DeviceManagerStateChanged Opened => Loaded
11.04.2017 15:18:34 84,873,216 DeviceManagerStateChanged Loaded => Closed
11.04.2017 15:18:34 84,893,696 Device manager is closed
11.04.2017 15:18:35 86,958,080 Unhandled exception: Type=System.Threading.ThreadAbortException, Message=Der Thread wurde abgebrochen., StackTrace= bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
bei Vintasoft.Twain.DeviceManager.ᜀ(Object A_0)
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart(Object obj), IsTerminating=False



Normally those ThreadAbortExceptions go unnoticed and the application keeps running, however, it is often bothering our users to see those exceptions in their logfiles. The Exception does not block or crash the application but it gets trapped by a generic "unhandled exception handler".

Any advice how we can prevent this sort of exceptions?

Re: System.Threading.ThreadAbortException

Posted: Sat Apr 15, 2017 10:53 am
by Alex
Hello,

Could you send us (to support@vintasoft.com) a small working project, which allows to reproduce the problem?

Best regards, Alexander