Continuous running background job in .NET 6 Console Application [Can run in a Docker Container]

Поделиться
HTML-код
  • Опубликовано: 11 сен 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 RUclips 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...

Комментарии • 13

  • @ptlh1969
    @ptlh1969 2 года назад +2

    Nice explanation :) Can you show an example in docker?

  • @martinzazvorka3835
    @martinzazvorka3835 2 года назад

    Great. I will go and refactor now. :)

  • @ashokk8888
    @ashokk8888 Год назад

    Will this if IIS goes to idle state?

  • @dhanarajsalaimani400
    @dhanarajsalaimani400 2 года назад

    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

    • @DotNetCoreCentral
      @DotNetCoreCentral  2 года назад

      Can you log into cloudwatch to see if it is getting any errors? Is it running on a Linux box?

  • @NagechaO
    @NagechaO 2 года назад

    where is example of deploying on docker ???

  • @vikramnoel1239
    @vikramnoel1239 2 года назад +1

    Hi Bro, Could you please make a tutorial on Azure.

  • @btogkas1
    @btogkas1 Год назад

    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

    • @DotNetCoreCentral
      @DotNetCoreCentral  Год назад

      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.

    • @btogkas1
      @btogkas1 Год назад +1

      @@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...

  • @ashwaniverma362
    @ashwaniverma362 2 года назад

    Please Sir,Explain how to run it in docker start to end