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
SerialPort is not supported on Mac Catalyst #75120
Comments
From @rolfbjarne on Tue, 06 Sep 2022 09:48:57 GMT The SerialPort class is currently not supported on Mac Catalyst:
Since this works for macOS apps, it seems to me that it just needs to be implemented for Mac Catalyst, so I'm moving this to dotnet/runtime where that code lives. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@rolfbjarne |
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsFrom @trantamcdt92 on Tue, 06 Sep 2022 09:07:49 GMT Steps to Reproduce
Expected BehaviorCan connect to device Actual BehaviorException "System.DllNotFoundException: libSystem.IO.Ports.Native" occurred EnvironmentMonterey, Visual Studio Preview Version information
Build LogsExample Project (If Possible)Copied from original issue xamarin/xamarin-macios#15874
|
VSMac pulls that from the System.IO.Ports nuget: https://www.nuget.org/packages/System.IO.Ports |
@Therzok yes, I know. I'd like to confirm whether using System.IO.Ports on MacOS is OK? |
where the "libSystem.IO.Ports.Native.dylib" Copy to debug/release directory? why when I copied to my Macbook Pro M2 can't run? |
Where did you copy this from and to? I have copied it over from other working MacOS projects (from the runtime folders) and into the same folder as my Mac Catalyst app, but am met with the same System.DllNotFoundException error. |
When you have installed Visual Studio Preview app in your Mac PC, the Visual Studio.app appears in the Desktop folder. You can see libSystem.IO.Ports.Native.dylib in the framework folder inside Visual Studio.app. Then copy this file to your executable folder. |
We're currently on the normal installation of VS 2022 v17.5. No Preview versions here, just a normal up to date install. I do not know where I would go looking for the equivalent file you are using. I have libSystem.IO.Ports.Native.dylib from the same version of a MacOS app of our libraries that works fine, compiled just minutes ago. If I copy and place that in the same folder as our Mac Catalyst maui app it isn't loaded/found |
Hi, We are developing MAUI multi platform desktop focused app, app needs to connect to a serial port to read UART data, we are able to achieve this on Win but Mac side is not working. It becomes major blocker for our project. How soon are you going to support mac and android platforms? For any update regarding this issue please let us know, thanks. |
Hi I am wondering if there is any progress with this issue? I've included <PackageReference Include="System.IO.Ports" Version="7.0.0" /> in my dependencies. This has a dependency to https://www.nuget.org/packages/runtime.osx-arm64.runtime.native.System.IO.Ports/ If I copy the So the whole ticket is not really about supporting MacCatalyst, but about fixing the build process to copy the required libraries, no? Is this related to the efforts made in #63187? I tried 8.0.0-preview.2.23128.3 without success. Thanks |
cc: @carlossanlop can you help us get this fixed? |
FWIW the native lib would compile just fine on iOS/tvOS/MacCatalyst if it was enabled ( runtime/src/native/libs/CMakeLists.txt Lines 145 to 147 in e1afb22
|
Any updates? It still doesn't work on my mac (Ventura 13.4) ... (Windows works perfectly) |
I am also very interested in getting Serial Port working in MacCatalyst.
I attempted your work around, copying both the SerialPort DLL and the native DYLIB files into the bin/debug. However, I get a "System.DllNotFoundException: libSystem.IO.Ports.Native" error. I tried with both the OSX-x64 and OSX-Arm64 native libraries to no avail. Are there any other steps I need to do? |
Hi @asi-evin, |
@nterreaux No dice unfortunately. Still get the following message:
|
@asi-evin Are your maccatalyst dependencies like mine? If not, I had to delete the output folder and restart the application... it didn't work the first time either, but now it does. This solution is by far not optimal, but in my case it does the job. |
Yeah, everything described is the same, but it still doesn't work. Thanks for the help, I'm just going to abandon this for now. |
Has anyone found a work around to the issue? It appears the DLL packaging been resolved, however now I am getting an explicit "Platform not supported" error message. It appears support is intentionally blocked. I have tried using SerialPortNet and SerialPortLibNetCore nuget packages, I couldn't get either to work on Maui Mac. I have an ORSSerialPort binding library from a Xamarin project that works fine in Xamarin, but have been unable to figure out how to get it ported to Maui. There is virtually no documentation or samples on binding libraries for Maui, let along Mac Maui. I've tried to get some native calls to work and only see Mac hard crashes with nothing helpful in the Apple crash report. Anyone have any solutions? This is holding up our port from Xamarin to Maui. It is a project that communicates over USB Serial to control heavy equipment via modbus protocol. |
The documentation on the Nuget package needs to be updated to remove Mac. Should that be a separate bug? It also lists support for Xamarin.Mac which is also not true. |
@jeffhandley hi, any updates on this issue? it became a blocker for our project as well would be down to contribute to resolve this issue. and would highly appreciate if you give me some direction on what's the most suitable way of doing it. |
It should be similar to #63187 + change @filipnavara suggested. I can take a look next week. |
@wfurt @akoeplinger does the merged pull request for #86619, which fixes the serial port issues for Android and Linux include a fix for Mac Catalyst? |
No, Catalyst is a different story but as far as I know @wfurt is working on it. |
This did not work for me either. Instead i got it working by copying the And make sure you have |
If anyone wants to try the fix from #96492 then you can add the following nuget feed to nuget.config: <add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" /> and use version 9.0.0-alpha.1.24058.11 or higher of the package: <PackageReference Include="System.IO.Ports" Version="9.0.0-alpha.1.24058.11" /> |
Any luck with the updated package @00000vish? |
Yes, its working as expected! Tested on Apple M1, Sonoma 14.1.1 |
From @trantamcdt92 on Tue, 06 Sep 2022 09:07:49 GMT
Steps to Reproduce
Expected Behavior
Can connect to device
Actual Behavior
Exception "System.DllNotFoundException: libSystem.IO.Ports.Native" occurred
Environment
Monterey, Visual Studio Preview
Version information
Build Logs
Example Project (If Possible)
Archive.zip
Copied from original issue xamarin/xamarin-macios#15874
The text was updated successfully, but these errors were encountered: