© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
4 replies
matcfs

❔ How to resolve System.UnauthorizedAccessException when a serial port is open but already in use

Hi there, I'm sorry for this newbie request but I looked for any solution on SO with no avail.
I have a simple .NET 4.5 software that use a Serial port to connect with a device. In the first form there a combobox with all serial port but even if I checked in advance if the portName is open, if the port is already in use the software there will be an infinite loop of Error in Serial Configuration due to System.UnauthorizedAccessException.
Do you have any suggestions? Thanks in advance.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

System.UnauthorizedAccessException [Answered]
C#CC# / help
4y ago
❔ System.Io.Ports: The given port name (COM4) does not resolve to a valid serial port.
C#CC# / help
3y ago
UnauthorizedAccessException [Answered]
C#CC# / help
4y ago
Opening serial port in windows service (Solved)
C#CC# / help
2y ago