Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topshelf process not really quitting #17

Open
vaniovanio opened this issue Aug 28, 2017 · 1 comment
Open

Topshelf process not really quitting #17

vaniovanio opened this issue Aug 28, 2017 · 1 comment

Comments

@vaniovanio
Copy link

Hi,

What could be done in order for the command window to close when the Topshelf service is disposed? I'm not able to find any information on that in the Topshelf documentation. Say, the "Admin.Service.exe" is running, I want to stop it, so I go to the window hosting it and press CTRL+C. This shuts down the service, but the executable is still running (e.g. I can see it in Task Manager). How can I avoid that?

Thanks! And great project, it gave me lots of insight on microservices in .Net.

@rbanks54
Copy link
Owner

rbanks54 commented Sep 8, 2017

Running it locally, I can't repro the problem you're having.

In program.cs the line:
s.WhenStopped(tc => tc.Stop());
should catch the Ctrl+C and call the stop method in the Admin Service class.

That Stop() method simply calls
webApp.Dispose();

So I suspect the Dispose() method is not finishing. Is it possible you have a long running request in your service that is not returning, which in turn is keeping a thread running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants