Can't get Bluetooth or Bluetooth LE to work in a C# Console App #346
-
When I tried the Bluetooth LE nuget I got an error "One or more errors occurred. (No path specified for UNIX transport)'" I've tried both nuget packages with the sample console apps here in Github and I can get neither of them to work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This happens when the generic net60 (or net70) dll is used from the NuGet rather than the Windows specific one. I'm looking into a way of improving this as it's not clear and currently the unix codebase doesn't throw PlatformNotSupported exception when called on another (probably Windows) platform. The reason for this is usually because the consuming project is a generic .NET project and doesn't specify a platform. It looks like the solution to this is to change the generic dll to include both Windows and Linux runtime support which will make the library bigger but simplify deployment. |
Beta Was this translation helpful? Give feedback.
-
var devices = await Bluetooth.ScanForDevicesAsync(); foreach (var device in devices) |
Beta Was this translation helpful? Give feedback.
This happens when the generic net60 (or net70) dll is used from the NuGet rather than the Windows specific one. I'm looking into a way of improving this as it's not clear and currently the unix codebase doesn't throw PlatformNotSupported exception when called on another (probably Windows) platform. The reason for this is usually because the consuming project is a generic .NET project and doesn't specify a platform. It looks like the solution to this is to change the generic dll to include both Windows and Linux runtime support which will make the library bigger but simplify deployment.