Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

I am implementing an aspnet backgroundservice rabbitmq consumer that subscribes to push events from the server: protected override async Task ExecuteAsync( CancellationToken stoppingToken) { ...
herme 0's user avatar
  • 982
0 votes
1 answer
56 views

I am running two identical background services, their only job is to pull from azure sub and send to API. I am pasting one below for the other one only the name changes and values for apiUrl, ...
confusedMind's user avatar
  • 2,663
0 votes
0 answers
135 views

I have console application for quartz.net operations. Its basically settings serilog options, loading IJob implemented business logics dll's, creating token source then starting host environment: ...
Unseen's user avatar
  • 79
0 votes
1 answer
355 views

I have the following interface in my .NET Core web application: public interface IIntegrationManagerService : IHostedService { Task<List<IFunciones>> GetFunctionList(); } The ...
jstuardo's user avatar
  • 4,517
1 vote
1 answer
934 views

I have some requirements for using some back ground process. I have 2 option # Time Trigger Function Background Service [Background tasks with hosted services] which one is more cost affective? I ...
Maulik Dave's user avatar
1 vote
0 answers
160 views

So far I have been using MediatR.Courier for subscribing to messages in my background services / asp.net hosted services. Why, because Hosted services are singletons, and NotificationHandler are not,...
Luka's user avatar
  • 4,211
0 votes
1 answer
213 views

I have an Windows Service, that connects to database. If database is not accesable it throws exception and stops. I want it to try and run this service in loop, until it is started succesfully (maybe ...
garyore's user avatar
0 votes
0 answers
270 views

I have a hosted service that executes a job/function periodically (a minute after execution). That job reads possibly millions of data and checks if needs to be modified by reading some data from the ...
Ahmet Koprulu's user avatar
1 vote
2 answers
2k views

I'm using the BackgroundService - is it possible to have multiple task in one background service project in .NET Core with different timer duration: FirstLoop - execute every second SecondLoop - ...
NDym's user avatar
  • 91
3 votes
1 answer
426 views

I created a background service to process items in a queue as demonstrated here: Queued Background Task Unlike the example, items are added to the queue via a Web API method that looks something like ...
DanO's user avatar
  • 1,013
1 vote
0 answers
1k views

I use the .NET Generic Host (to run a BackgroundService). All the examples I've seen (example) use host.Run[Async], so I use that and it works for me. However there are a number of related lifetime ...
lonix's user avatar
  • 22.5k
1 vote
3 answers
2k views

Due to bugs in BackgroundService I'm using Stephen Cleary's excellent workaround. It works, but I can't return a non-zero exit code upon failure. A minimal working example (for use with the $ dotnet ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
461 views

I have the following code: builder.Services.AddSingleton<IAvailabilityWorker, AvailabilityWorker>(); builder.Services.AddHostedService<AvailabilityWorker>(); There is a timer in the ...
Foxxy's user avatar
  • 25
0 votes
0 answers
104 views

On server I use background service + SignalR hub to send time to all clients. Client-side is written using Winforms. The server is sending correct data to client: (check log) Worker running at: ...
Duane's user avatar
  • 1
2 votes
1 answer
241 views

This is my code in .net core 5 which wants to trigger a function every 2 minutes. I don't know why LoadData function doesn't get triggered after 2 minutes and only get triggered the first time? public ...
Negin's user avatar
  • 169
0 votes
0 answers
99 views

I am trying to set up a form with blazor webassembly and asp.net core hosted. I'm using .Net 7. The form in client side sends the data entered by an unknown user to the api server side. No user ...
Sébastien Foucher's user avatar
1 vote
1 answer
570 views

Working on a BackgroundService that is published to Azure as a Web Job, I noticed something strange (works fine on Azure, exception when running locally), so I tried to recreate the situation. Program....
Florin Ghisa's user avatar
0 votes
1 answer
424 views

I've a Blazor server app that is installed as windows service and runs fine. The default application URL is "http://localhost:5000" and I want to configure it so that it could be rechable ...
ashokoienia's user avatar
0 votes
1 answer
2k views

Problem with trying to add the Hosted Service to the Application I'm trying to add Hosted Service to my application, but it seems not to work at all (In debug none of its methods were called). Here is ...
SYKO's user avatar
  • 81
3 votes
3 answers
9k views

I'm creating a new console app for the first time in a while and I'm learning how to use IHostedService. If I want to have values from appsettings.json available to my application, the correct way now ...
Bob Tway's user avatar
  • 9,693
1 vote
2 answers
199 views

I have the following two alternatives: protected override Task ExecuteAsync(CancellationToken stoppingToken) { _ = ForeverRunningLoop(stoppingToken); return Task.CompletedTask; } private ...
mnj's user avatar
  • 3,691
0 votes
1 answer
1k views

I have three services running on .NET with OpenTelemetry tracing enabled. Communication begins from the first service to the second one via HttpClient. The second service handles an HTTP request and ...
Leonid Idelchik's user avatar
2 votes
1 answer
2k views

I have a .NET 6 web application with HostedServices doing background processing. When the HostedService starts Activity just after the application starts, this Activity is not exported by the ...
grzegorzorwat's user avatar
3 votes
1 answer
655 views

I have an azure function whose startup looks like this internal class Startup : FunctionsStartup { public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder) ...
Sankar Mantripragada's user avatar
0 votes
0 answers
103 views

The Problem: How to establish a hosted service (background service) which can receive, process and send messages from a signalR hub? The story: Step 1. Client #1 runs a blazor (server-side) App. The ...
pilotnik's user avatar
0 votes
1 answer
93 views

I will be using .NET 6 for a project that will execute scheduled jobs. I don't want to run the service as a Windows or Linux service. No while loop or Task.Delay hack should be used. I'm planning to ...
Stack Undefined's user avatar
2 votes
1 answer
2k views

I have an IHostedService which will use IHostApplicationLifetime.StopApplication if it fails during StartAsync. At first I thought I had missed out exception catching somewhere in my code when a ...
dev01's user avatar
  • 197
1 vote
0 answers
435 views

I am migration an app from .NET Framework to .NET 6. It starts Kestrel web server internally and it is intended to run as a Windows Service - in the old version that was achieved using Topshelf ...
Ventsislav Petrov's user avatar
1 vote
1 answer
652 views

How to create a global variable that can be unique per hosted service execution? Complete Code: https://github.com/matvi/dotnet-hosted-services The problem: When running hosted services is difficult ...
mavi's user avatar
  • 1,146
0 votes
1 answer
2k views

Inside a .net web app, I set up a hosted service to receive messages from an Azure Service Bus topic. The problem is that not all messages are received, only an arbitrary amount (e.g. of 20 messages ...
Raphael Springer's user avatar
0 votes
0 answers
144 views

At the moment I have .NET Core Web API running on a Raspberry Pi, the job of this API is to collect data from a connected device on an interval and save the data to a DB, which is what it does already....
kylebotha's user avatar
2 votes
0 answers
243 views

I'm running .NET Core 5.0 services on Docker, sometimes with multiple instances of the same service. Some of the services have "Hosted Services" registered in their Startup.cs file. However, ...
The Zingerator's user avatar
2 votes
1 answer
11k views

Create Multiple Background tasks in .NET 6 which are independent to each other in functionality aspect and runs parallelly / simultaneously depending on the scheduled timings. With Worker class ...
HariPrasad kasavajjala's user avatar
1 vote
1 answer
352 views

I wanted to create a background task for my application and in that task I need DbContext to do some operation on data for every 5 seconds.I tried 2 way to get DbContext and it seems like both of them ...
voyager861's user avatar
2 votes
1 answer
2k views

Background services deployed as Windows Services stopped working. It happened after we migrated from .Net core 3.1 to .Net 6. Services are created using IHosted Service. Services are type of Time ...
kashir hasan's user avatar
2 votes
0 answers
2k views

I noticed HostedServices are ran in a single threaded Async mode. Is it possible to have each hosted service running on its own thread? I am having several hosted services running, for testing ...
user3533755's user avatar
1 vote
0 answers
1k views

I'm currently working on a project which processes files via a Hosted Service background task, persists those files to a DB, then show the user that data via a webpage. The webpage and the background ...
9Deuce's user avatar
  • 686
8 votes
2 answers
11k views

I have an API which contains a HostedService that is built in VS2022 with .Net 6. When I run locally the service is called as expected and everything works fine but when deplyed, the service doesn't ...
tdean's user avatar
  • 558
0 votes
1 answer
2k views

I try everything I can think of but I must miss something. I have a hostedService project in netcoreapp3.1 I referenced the following <PackageReference Include="Microsoft.ApplicationInsights....
Guillaume's user avatar
  • 1,244
22 votes
2 answers
24k views

The ASP.NET Core docs for background services show a number of implementation examples. There's an example for starting a service on a timer, though it's synchronous. There's another example which is ...
lonix's user avatar
  • 22.5k
0 votes
1 answer
421 views

I am having .net a self-hosted application, basically, it runs for 12 hours. The entire functionality is working as expected in my local machine. Reference: Background tasks with hosted services in ...
akhil's user avatar
  • 1,893
1 vote
1 answer
2k views

I have a ASP.NET Web-API which has a IHostedService to periodically execute a specific Task (fetch data from another website and write it to the Database). This works well on IIS-Express (starting ...
totallynotatallno's user avatar
16 votes
2 answers
62k views

I am using .NET 5 and I want to run a background task using IHostedService classess as you can see: public class PasargadJobs : IHostedService, IDisposable { private Timer _timer = null!; ...
Ehsan Akbar's user avatar
  • 7,357
1 vote
1 answer
2k views

I have a .net Core application hosted on IIS. The application initializes WebSocketServer, by adding a wrapper class as a HostedService. The hosted service execute the Start() method seen below on its ...
Guy E's user avatar
  • 1,957
0 votes
0 answers
618 views

I have an console application .NET core which uses Background tasks with hosted services like described here : link I've used the code sample provided by Microsoft and added the IBackgroundTaskQueue, ...
Julien Martin's user avatar
1 vote
0 answers
636 views

We have a hosted service which transcribes data from the Azure Service Bus to another microservice. Aside from putting data in a Queue on the service bus, there is no opportunity for a human to ...
Brian Kessler's user avatar
14 votes
4 answers
8k views

I have .NET Core web API project, for some reasons, we created a background service in this project and start running the background service while the application is started. So, we created a ...
CF7's user avatar
  • 179
2 votes
1 answer
2k views

I am working on a .net generic host app and I would like to pass some configuation via command line and then bind it to an object: public class CommandArgs { public string Mode { get; set; } ...
patrykito's user avatar
0 votes
1 answer
1k views

I got some problems with HostedService / background classes in my ASP.NET MVC project. What I need is a timer that process some functions every X seconds and when those functions reach goals, go to ...
Faggiano's user avatar
1 vote
2 answers
494 views

I'm trying to load related entities in a console application that runs a BackgroundService, but it doesn't load related entities, I have had this problem for hours now and I just noticed it happens ...
mshwf's user avatar
  • 7,537