Open DevInOrbit opened 1 year ago
i ran into the same problem.
temporary solution is to use <TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
My current csproj looks like this
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InTheHand.BluetoothLE" Version="4.0.34" />
</ItemGroup>
</Project>
The code like this:
// See https://aka.ms/new-console-template for more information
using InTheHand.Bluetooth;
Console.WriteLine("Hello, World!");
var discoveredDevices = await Bluetooth.ScanForDevicesAsync();
It fails with the following error
Unhandled exception. System.NotImplementedException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
at InTheHand.Net.Sockets.BluetoothClient.PlatformInitialize()
at InTheHand.Net.Sockets.BluetoothClient..ctor()
at Program.<Main>$(String[] args) in W:\tmp\bluethooth\Program.cs:line 6
Same issue on Windows 11
with .net6
Idea with net7.0-windows
sdk is not working for me. I still see error with message No path specified for UNIX transport
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Hi, I'm having the same issue in Windows 11 with .net 8.0, changing the .net version does not help in my case as well.
Has anyone found a Solution or workaround for this?
+1 Win 10 .NET 8 & .NET 7
I have the same problem, but I found temproary working solution.
Also I use advice from here.
Change target framework to:
Here is my csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>x64</Platforms>
<SupportedOSPlatformVersion>10.0.22621.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InTheHand.BluetoothLE" Version="4.0.35" />
</ItemGroup>
</Project>
I use Win10, VS 2022 (17.6.2).
Now I getting results from Bluetooth.ScanForDevicesAsync() without errors
Similar issues, but since I'm not on .net8 and windows 11, this is my csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InTheHand.BluetoothLE" Version="4.0.36" />
</ItemGroup>
</Project>
I believe just specifying the target framework was the crucial piece in this. Most everything else doesn't really matter.
I found it odd that <TargetFramework>net8.0-windows</TargetFramework>
didn't work, but unsure of the details here.
Nearly a year after this was raised...
If you want to know what to set for TargetFramework Have a look at the dependency for the nuget package.
Look for net7.0-windows10.0.19041 as of 4.0.36 for InTheHand.BluetoothLE
Using latest Nuget package and running on Windows 10, calling Bluetooth.ScanForDevicesAsync() results in this exception:
Tmds.DBus.ConnectException: 'No path specified for UNIX transport'
Target framework .NET 7 (tried 6 also) Visual Studio 2022 Tried setting target OS windows 10, 8 and 7 with same results.
Did I miss a vital configuration step or is this a valid defect. Thanks!