-
-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth.RequestDeviceAsync() Not show UI "List with available devices" #394
Comments
Is there any output in the debug window to indicate an error when you call RequestDeviceAsync? My guess is it is the code to get the HWND for the console window as this is more problematic than a desktop application. |
I see in VS output that information: 'BluetoothWin.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'D:...\BLE_Test\BluetoothWin\bin\Debug\InTheHand.Net.Bluetooth.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. // Here start Run Task Bluetooth.RequestDeviceAsync() 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_ru_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols. // Result is back The thread 0x666c has exited with code 0 (0x0). |
Output above was represent a fail behavior. For comparison below is Sucess call RequestDeviceAsync(), with open UI to choose avaliable devices, and with choose 1 by click from list 'BluetoothWin.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'D:...\BLE_Test\BluetoothWin\bin\Debug\InTheHand.Net.Bluetooth.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_ru_b77a5c561934e089\mscorlib.resources.dll'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.Devices.winmd'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.Foundation.winmd'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.UI.winmd'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.ApplicationModel.winmd'. Module was built without symbols. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Remote Debugger\x64\Runtime\Microsoft.VisualStudio.Debugger.Runtime.Desktop.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'BluetoothWin.exe' (CLR v4.0.30319: BluetoothWin.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. |
I'm not sure if it's related, but in my UI-based application the Now, I'm not sure what is the "ui-thread" of a console application, probably simply the main thread. |
Im write Windows Console Application, try to call code below:
Result is null without show UI "List with awaliable devices". For fix that im always need a few time make a Clear solution and make a new rebuild for work.
What i need a do for show UI each time when call Bluetooth.RequestDeviceAsync()?
Im use :
The text was updated successfully, but these errors were encountered: