System.IO.Ports error

I have written code for serial communication between Arduino and Unity in C# using Visual Studio but it is giving me error for using System.IO.Ports;

The error is
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name ‘Ports’ does not exist in the namespace ‘System.IO’ (are you missing an assembly reference?) Assembly-CSharp C:\Users\Omkar Mugdar\My First Unity Game\Assets\SERIAL_COMM.cs 4 Active

Please help me to resolve this error.

1 Like

Howdy, The above solutions did not work for me unfortunately. Found a fix that did however. My target platform is Windows and I changed the architecture in build settings from x86_64 to x86. After that System.IO.Ports was referenceable.

1 Like