Hi @EuroEager2008 ,
I didn't find a template to run worker service in asp.net core app/API project officially. But there are some clues to do this. Although the article uses Ihost to build service project. You can still register the service class directly to asp.net core project which host by webapplicationbuilder like below.
builder.Services.AddHostedService<TimedHostedService>();
builder.Services.AddHostedService<Worker>();
(Note that the 'worker' is copy from the default worker service template," TimedHostedService" is the code from https://learn.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?source=recommendations&view=aspnetcore-7.0&tabs=visual-studio#timed-background-tasks ).
They will work the same as in a Ihostbuilder project.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.