我刚刚开始研究 Arduino-Unity 接口(interface),但遇到了这个错误。
using UnityEngine;
using System.IO.Ports;
我认为代码中没有问题。我还尝试将 API 兼容性级别更改为 .NET 2.0 但这对我不起作用。
最佳答案
Also I have tried changing API Compatibility Level to .NET 2.0 But that did not worked for me.
1。将 API 兼容性级别更改为 .NET 2.0
2。保存 Unity 项目,关闭 Unity,然后重新启动 Unity。
3。关闭 Visual Studio 或 MonoDevelop(具体取决于安装的版本)
4。重新启动 Visual Studio 或 MonoDevelop
完成!有时,您不需要执行步骤2。步骤1、3和4应该可以解决这个问题。
关于visual-studio - 使用 Unity 时出错。没有解决方案有效..错误 CS0234 : The type or namespace name `Ports' does not exist in the namespace `System.IO' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37910933/