Visual c++ 2005 'Ports': 不是 'System::IO' 的成员

Visual c++ 2005 'Ports' : is not a member of 'System::IO'

我正在尝试在安装了 .Net Framework 2 的 Microsoft Visual Studio 2005 中使用 SerialPort,但我无法编译下面的简单示例:

using namespace System::IO::Ports;
SetParameters(1, 9600, 8, System::IO::Ports::Parity::Even, 300);

因为 'Ports' : 不是 'System::IO' 的成员,我已经激活了通用语言运行时支持 (/clr)。

只需在源代码中添加#using < System.dll >