The following is the complete Debug output for running the Startup Task. Two versions are shown. One with Managed Code Debugging and one with Native Code Debugging. Mixed is not permitted. An exception is thrown when the FTManager is instantiated. This error is not trapped by a Managed Code (c#) try-catch

 

Debug Window when run in Managed Code Only Mode

'backgroundTaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'c:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.1.0_1.0.23302.0_arm__8wekyb3d8bbwe\mscorlib.ni.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDISimpleHeadless.winmd'. Symbols loaded.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\WinMetadata\Windows.winmd'. Module was built without symbols.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.InteropServices.WindowsRuntime.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDI.D2xx.WinRT.winmd'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Diagnostics.Debug.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Collections.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Linq.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.ObjectModel.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.Extensions.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Threading.Tasks.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Reflection.dll'. Module was built without symbols.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Text.RegularExpressions.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Globalization.dll'. Module was built without symbols.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.WindowsRuntime.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDI.D2xx.WinRT.USB.winmd'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Threading.dll'. Cannot find or open the PDB file.
Exception thrown: 'System.InvalidOperationException' in FTDI.D2xx.WinRT.winmd
1.0.2.0
The thread 0xadc has exited with code 0 (0x0).
The thread 0xad8 has exited with code 0 (0x0).

Debug Window when run in Native Code Only Mode

'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\backgroundTaskHost.exe'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\kernel32legacy.dll'. Cannot find or open the PDB file.
The thread 0xfb8 has exited with code 0 (0x0).
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\procthreadexthost.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\twinapi.appcore.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\userenv.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\rsaenh.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Cannot find or open the PDB file.
Exception thrown at 0x776BA72F (KernelBase.dll) in backgroundTaskHost.exe: 0x40080201: WinRT originate error (parameters: 0x8000000B, 0x00000040, 0x0021E6D8).
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\MrmCoreR.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\actxprxy.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\biwinrt.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\UWPShim.exe'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.1.0_1.0.23302.0_arm__8wekyb3d8bbwe\UWPHost.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.1.0_1.0.23302.0_arm__8wekyb3d8bbwe\coreclr.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\advapi32legacy.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Cannot find or open the PDB file.
Exception thrown at 0x776BA72F (KernelBase.dll) in backgroundTaskHost.exe: 0x04242420 (parameters: 0x31415927, 0x6D170000, 0x0048E9A8).
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.1.0_1.0.23302.0_arm__8wekyb3d8bbwe\mscorlib.ni.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDISimpleHeadless.winmd'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\WinMetadata\Windows.winmd'. Module was built without symbols.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.InteropServices.WindowsRuntime.dll'. 
Exception thrown at 0x776BA72F in backgroundTaskHost.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0048DB40.
Exception thrown at 0x776BA72F in backgroundTaskHost.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x776BA72F in backgroundTaskHost.exe: Microsoft C++ exception: EETypeLoadException at memory location 0x0048DB40.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDI.D2xx.WinRT.winmd'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Diagnostics.Debug.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Collections.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Linq.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.ObjectModel.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.Extensions.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Devices.Usb.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\winusb.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Devices.Enumeration.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\DevDispItemProvider.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Threading.Tasks.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\Windows.UI.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\MinUser.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\ninput.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\dcomp.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Reflection.dll'. Module was built without symbols.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Text.RegularExpressions.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Globalization.dll'. Module was built without symbols.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Runtime.WindowsRuntime.dll'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\BCP47Langs.dll'. Cannot find or open the PDB file.
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\FTDI.D2xx.WinRT.USB.winmd'. 
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Users\DefaultAccount\AppData\Local\DevelopmentFiles\FTDISimpleHeadless-uwpVS.Debug_ARM.david\System.Threading.dll'. 
Exception thrown at 0x776BA72F (KernelBase.dll) in backgroundTaskHost.exe: 0xE0434352 (parameters: 0x8000000E, 0x00000000, 0x00000000, 0x00000000, 0x6D170000).
1.0.2.0
'backgroundTaskHost.exe' (Win32): Loaded 'C:\Windows\System32\threadpoolwinrt.dll'. Cannot find or open the PDB file.
The thread 0x814 has exited with code 0 (0x0).
The thread 0x82c has exited with code 0 (0x0).
The thread 0x5ec has exited with code 0 (0x0).
The thread 0xfcc has exited with code 0 (0x0).
The thread 0xfd4 has exited with code 0 (0x0).
The thread 0xfc8 has exited with code 0 (0x0).

 

The exception clearly comes from the instantiation of the FTManger in:the following code:

                ftManager = new FTManager();
                string ver = FTManager.GetLibraryVersion();
                System.Diagnostics.Debug.WriteLine(ver)

Further

  • If the timer is disabled, no impact.
  • If the code above is commented out then the exception does not occur. Just commenting the last two lines doesn’t remove it.
  • Of interest is that if a breakpoint is put immediately after the code above the Exception Debug message does not occur. If then the next line is stepped over or the code is allowed to free run, then the message occur then..
  • So the exception is possibly a timeout in FTManager.