RS232 library for .net core

2019-06-15 15:07发布

问题:

We are developing applications in .Net Core and one of them require to access a serial port.

As I learned that System.IO.Ports won't be implemented in .Net Core, I was looking for a nuget library that supplies that functionality, but couldn't get one compatible with .net core (VS Code is showing an error message).

Is there any alternative out there?

UPDATE: I found that the official SerialPort API is being taken into consideration for porting to .Net Core (see https://github.com/dotnet/corefx/issues/984)

回答1:

I managed to compile https://github.com/jcurl/SerialPortStream for netstandard1.5 with some minor modifications.

Have a look at the pull request: https://github.com/jcurl/SerialPortStream/pull/13

Experimental nuget package: https://www.nuget.org/packages/SerialPortStreamCore/2.1.0