Is there the possibility to run some code when the Code is stopped when running it from Visual Studio?
I am using the CefGlue library to build a WinForms application and realized that there are issues when pressing the stop button ranging from Exception to two windows with no content opening. A separate process continues to run in the background. In order to stop Cef nicely I need to exectue CefRuntime.Shutdown();
Maybe this is because it does not run the application in a Visual Studio hosting process, because CefGlue has problem with this (see this). This does not affect production but is nasty while developing and testing, but nevertheless I would like to execute some code to fix the problem.
I would guess this is not possible but if it was it would be interesting to know.
So I am looking for a way to execute some code when Visual Studio is stopping the application when pressing the stop button while in development.
Note: I am using Visual Studio 2013 and 2015.
Edit The issue is not reproducibly with very few lines of code. Nevertheless I have tried to create a simplified example here