使用 .Net Core 3.0 访问 SerialPort 类 [英] Accessing the SerialPort class using .Net Core 3.0

查看:32
本文介绍了使用 .Net Core 3.0 访问 SerialPort 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在启动一个新的 .NET Core 3.0 项目,我需要在其中访问 System.IO.Ports.SerialPort 类.我在该课程上阅读的文档表明它适用于 .NET Core 3(请参阅

I'm starting a new .NET Core 3.0 project in which I need to access the System.IO.Ports.SerialPort class. The documentation I'm reading on the class shows that it is applicable to .NET Core 3 ( see the bottom of https://docs.microsoft.com/en-us/dotnet/api/system.io.ports.serialport?view=netcore-3.0 ). However when I add a using statement to my class it isn't able to resolve System.IO.Ports. Is there some additional step that needs to be done to reference the SerialPort class for a .NET Core 3.0 program running on the Windows desktop?

解决方案

Found the answer a few moments after I posted this question. To use the SerialPort class there is an additional package that needs to be installed. I was able click QuickActions icon to install the package.

这篇关于使用 .Net Core 3.0 访问 SerialPort 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆