C# windows application not closing

后端 未结 2 750
花落未央
花落未央 2021-01-28 02:54

I have a C# windows application. I placed it on a test server, whose set up is not controlled by my company and neither is the seurity context. I double click the exe. App runs

相关标签:
2条回答
  • 2021-01-28 03:00

    Abusing Application.DoEvents() is another way to get into this kind of trouble. If you cannot kill the .exe from TaskMgr, your app is stuck waiting for a driver to finish an I/O request.

    0 讨论(0)
  • The likely cause is that a background thread is still running after your application is closed. Depending on your framework and application configuration a background thread can cause a process to keep running even after the main window is closed.

    Do you have any threads in your process? If so make sure to close them out when the main application window is closing. A good place to do this is in the OnClosing method of a Windows Form

    0 讨论(0)
提交回复
热议问题