从串行端口在VB.NET System.UnauthorizedAccessException的串行、端口、VB、UnauthorizedAccessException

2023-09-04 05:25:20 作者:超级无敌的可乐お°

我使用VB.NET 2008例preSS版访问串口这是一个USB转串口。由于这是可移动的,应用程序,用户可以在应用程序的任何时间将其断开。我得到一个未处理的异常,当我删除USB串行端口。

I am using VB.NET 2008 Express Edition to access Serial Port which is a USB to Serial port. Since this is removable, the app user can disconnect it at any time in app. I am getting an unhandled exception when I remove the USB Serial Port.

经过研究,这似乎是在.NET中(即使是在3.5),一个已知的问题

After research, it seems like a known problem in .NET (even in 3.5)

我在找一些解决方案来完成这件事。我已经尝试了建议,在app.config解决方案,这是行不通的。

I am looking for some solution to get this done. I have already tried the app.config solution that was suggested and it does not work

下面的链接问题 的http://connect.microsoft.com/VisualStudio/feedback/Validation.aspx?FeedbackID=140018

推荐答案

这帮助我在类似的情况,并声称解决各种问题的SerialPort在.NET中: http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html

This helped me in a similar situation and claims to solve all kinds of problems with SerialPort in .NET: http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html