Problem in accessing the COM port. "Access denied for COM1 "
-
I have a hardware connected to the usb which communicates by sending the data.When i will start the application and hardware as a fresh it will work fine.But when i will stop my hardware and run it again it will throw me a exception handle stating that the Access denied for COM1: as you dont have proper rights to the resource.But when i remove the USB plug and re connects my application to the hardware it will start working. Do anyone know how to reset or re intiallize or reconnect the usb to hardware programitically...?
-
I have a hardware connected to the usb which communicates by sending the data.When i will start the application and hardware as a fresh it will work fine.But when i will stop my hardware and run it again it will throw me a exception handle stating that the Access denied for COM1: as you dont have proper rights to the resource.But when i remove the USB plug and re connects my application to the hardware it will start working. Do anyone know how to reset or re intiallize or reconnect the usb to hardware programitically...?
-
How about closing it ? SerialPort serialPort = new SerialPort(...); serialPort.Open(); ... ... ... serialPort.Close(); // <- close the connection serialPort.Dispose(); // <- dispose resources in serialPort, use it if you close your application
-
I tried all the stuff u mentioned, but it didnt work.I need to unplug and plug again to make it work.So i am looking is there any way to unplug problematically.
-
Probably you are using a thread, and the thread is still active ? You must end the thread. What happened if you close your application and start it again ?
No I am not using any thread.Even i close and run the applicatio i face the same problem.As i mentioned i need to remove and place the cable again to re communicate the data.
-
No I am not using any thread.Even i close and run the applicatio i face the same problem.As i mentioned i need to remove and place the cable again to re communicate the data.
-
That means, there are something wrong with your USB-COM adapter. Try to install the newest driver. Probably it's a bug in driver.
-
I have updated with the latest drivers and still i face the same issue. Unfortunately it is not working with any other hardware also.