visual-studio - 使用 Unity 时出错。没有解决方案有效..错误 CS0234 : The type or namespace name `Ports' does not exist in the namespace `System.IO'

标签 visual-studio unity-game-engine arduino serial-port ports

我刚刚开始研究 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 StudioMonoDevelop(具体取决于安装的版本)

4。重新启动 Visual StudioMonoDevelop

完成!有时,您不需要执行步骤2。步骤134应该可以解决这个问题。

关于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/

相关文章:

visual-studio - Visual Studio 的 viEmu 插件有什么意义?

c++ - 在 Visual Studio C++ 中访问程序数据库时出错

visual-studio - Visual Studio 调试器的线程问题

unity-game-engine - LoadLevelAdditive 和 UnloadLevel

ios - "Different language linkage"— xcode 4 中的警告,xcode 5 中的错误

c++ - MS Visual Studio 2008 上的 stdlib.h 的 random()

unity-game-engine - 我对 Unity ScrollRect/ScrollView 优化/性能的了解

c++ - 即使串行可用,代码也会继续循环

arduino - 如何将OV7670连接到Arduino Leonardo?

azure - 将 Arduino Uno 数据直接解析到 IoT