EXCEPTION: System.IO.IOException: Insufficient system resources exist to complete the requested service

Hello Experts,

I'm working on Windows application, talking to a Device on Virtual COMM.

It fails to communicate the device and throws this exception:

EXCEPTION: System.IO.IOException: Insufficient system resources exist to complete the requested service.
   at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
   at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
   at System.IO.Ports.SerialPort.Open()
   at Tel.SetComm.Serial.Port.Open()
   at TelComm_Library.CSet.Test(Int32 maxAttempts)

I see the  Virtual Comm port on my device manager, but still cannot open the comm port.

But in the past, I talked to the same device multiple times with different Virtual comm#.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SAMIR BHOGAYTAFreelancer and IT ConsultantCommented:
Hi, you use the memory flush() function for solving the above exception.
Miguel OzSoftware EngineerCommented:
It may be a service pack or hot fix introducing the issue described here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ASPDEVAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.