System.IO.Ports only availble on windows, but im using windows - .NET6

Borda Ákos 20 Reputation points
2024-03-17T16:58:29.7233333+00:00

So i'm trying to read arduino serial from c#, but it shows me the folowing exeption when i try to open the port:

System.PlatformNotSupportedException: 'System.IO.Ports is currently only supported on Windows

I am currently using windows 11.

Also i tried setting the target OS to windows in the .csproj file.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,075 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,244 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. VC 0 Reputation points
    2025-01-26T11:44:42.4566667+00:00

    I got the same exception when using the system.io.ports 9.0.x version on .net 6.0 on windows

    I changed the system.io.ports package to version 8.0.0, it worked!!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.