Skip to content
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

PlatformNotSupportedException on Win11 #445

Open
MyZQL opened this issue Dec 3, 2024 · 1 comment
Open

PlatformNotSupportedException on Win11 #445

MyZQL opened this issue Dec 3, 2024 · 1 comment

Comments

@MyZQL
Copy link

MyZQL commented Dec 3, 2024

I just started a new console program to have a test, then I met the PlatformNotSupportedException when i called the ScanForDevicesAsync() method. Here is my project info:

<Project Sdk="Microsoft.NET.Sdk"> // Win11 SDK 10.0.22621

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="InTheHand.BluetoothLE" Version="4.0.37" />
  </ItemGroup>

</Project>

And my demo code:

public static void BleScanTest1()
{
    Bluetooth.AdvertisementReceived += BluetoothOnAdvertisementReceived;
    Bluetooth.ScanForDevicesAsync().GetAwaiter().GetResult();
}

Are there any prerequisites for a console program?

@gdidelot
Copy link

Hello,

I've the same issue... Have you found a work around ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants