Continuous running background job in .NET 6 Console Application [Can run in a Docker Container]
Вставка
- Опубліковано 6 жов 2024
- #dotnet6 #consoleapplication #backgroundjob
Running a background job inside of a console application is challenging especially if it is running inside a docker container if you do not know the proper way to implement that. In this video, I walk through how to do it very easily using .NET 6 features. Hint, not using Console.ReadLine :)
My UA-cam channel: / dotnetcorecentral
My Blog Website: dotnetcorecent...
My Github repo: github.com/cho...
Some of my popular videos:
Elasticsearch with .NET and introduction: • An Introduction to Ela...
Hangfire Scheduling an introduction: • Scheduling recurring j...
ASP.NET Core Authentication with JWT (JSON Web Token): • ASP.NET Core Authentic...
Running Background tasks using IHostedService and BackgroundService (In ASP.NET Core 3.1): • Running Background tas...
How to build an API Gateway in ASP.NET Core using Ocelot (Build API Gateway in a few minutes): • How to build an API Ga...
Nice explanation :) Can you show an example in docker?
Great. I will go and refactor now. :)
Thanks!
Hi Bro, Could you please make a tutorial on Azure.
Sure will
The problem in this example as far as i know is that you can only have one service since it needs to complete start async to continue to the next service
No, thats not correct, you can have multiple background job in a console application. Share me the code where you tried it and it did not work, I can help take a look.
@@DotNetCoreCentral Yeah it works as you say, i have tested it out. There was a link i saw it in a Microsoft doc but cant find the link that said the opposite...
Please Sir,Explain how to run it in docker start to end
where is example of deploying on docker ???
Will this if IIS goes to idle state?
It works on my machine while debugging but after I host the application on aws ec2 the background service is not running. Any ideas? Thank you
Can you log into cloudwatch to see if it is getting any errors? Is it running on a Linux box?