0

I am using Background Service on .NET Core API project and the service is working properly on my machine but after publishing it is not working on the server The APIs are working but the background service isn't. is there any setups I have to do in my IIS?

New contributor
Youssef Emad is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • AFAIK - no extra setup is needed for hosted services under IIS (note that there are some quirks like app pool recycling, etc, which in theory can lead to the whole app stopping including the hosted services).
    – Guru Stron
    May 18 at 10:14
  • As for the question - there is not enough info provided to provide any help except for the guess work. Please at least share some code.
    – Guru Stron
    May 18 at 10:16
  • It worked for me after calling a random api inside the project May 18 at 11:08
  • Yep, that what I was refereeing to in the "quirks section". In short - if you want constant processing you better should not host it under IIS (personally I prefer to host it inside different app, not the ASP.NET Core one)
    – Guru Stron
    May 18 at 11:22
  • You need to set the IIS application for your API to use the "Always Running" start mode. You can see how to do this via this SO answer: stackoverflow.com/a/59305823/654081
    – richard_ob
    May 18 at 21:25

0

Browse other questions tagged or ask your own question.