The server doesn't want to shutdown following WPF exit
Closed this issue · 0 comments
bromoapp commented
Hi, I don't know whether this is an issue or not. But these are what happened:
- I RUN the server from the initial method of MainView.xaml.cs which is a subclass of WPF Window class
- Then I override OnClosing(CancelEventArgs e) in order to handle Window's close button clicked
- Inside the override OnClosing method, I STOP the server
With this approach, I hope the web server will shut down together with the app closing.
But what I found out, my visual studio is still in RUNNING the DEBUG mode.
Before I use your server as an embedded web server whenever I click the Window close button, visual studio will go back to EDITING mode. So I believe there is a running thread remains. How should I properly shutdown your server?