名称空间'System.IO'中不存在类型或命名空间名称'Ports'(您是否缺少程序集引用?) [英] The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)
问题描述
嗨 -
我正在开发Windows 8.1系统上的Windows应用程序应用程序64位(我需要在我的windows surface pro 3平板电脑上部署此应用程序)。我需要通过RS-232端口进行通信。为此,我使用的是SerialPort类,它位于命名空间System.IO.Ports下。但是当我在我的C#代码中包含它时,我收到错误 -
名称空间'系统中不存在类型或命名空间名称'Ports' .IO'(你错过了一个程序集参考吗?)
我安装了windows SDK 8.0。这个问题的可能原因是什么?有没有其他人通过RS-232端口进行通信。
任何指针或建议都会非常有用。
问候,
Shikha
Hi -
I am working on developing a windows store app on my windows 8.1 system,64 bit (I need to deploy this app on my windows surface pro 3 tablet). I need to communicate through the RS-232 port. For this I am using the SerialPort class which falls under the namespace System.IO.Ports. But when I am including this in my C# code, I am getting the error -
"The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)"
I have the windows SDK 8.0 installed. What could be the probable reason for this issue ? Is there any other was to communicate through the RS-232 port .
Any pointer or suggested would be really helpful.
Regards,
Shikha
推荐答案
检查您是否有对System.dll程序集的引用 - System.IO.Ports在该文件中。
Check you have a reference to the System.dll assembly - System.IO.Ports is in that file.
这篇关于名称空间'System.IO'中不存在类型或命名空间名称'Ports'(您是否缺少程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!