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

I have a .NET 4.7.2 console application that uses .NET Generic Host and has 2 background services. One of them (dependent) should start its work only after another one (base) has completed its ...
bairog's user avatar
  • 3,539
1 vote
0 answers
153 views

I am discovering .NET Aspire and trying to migrate a solution to it. In the solution, I have several Worker applications that are using the HostApplicationBuilder with HostedServices. Initially these ...
Sam Vanhoutte's user avatar
0 votes
0 answers
63 views

I have a .NET 8 application which, among other things, has the following functionality: it contains a hosted service that fetches some records from a database, produces some .txt files and writes them ...
Giorgos Manoltzas's user avatar
0 votes
1 answer
284 views

In my application I have some services to manage some devices on a PC (mainly via serial ports). Services will be accessed through API controllers. Each service must run as singleton (single instance) ...
Simon's user avatar
  • 155
0 votes
3 answers
212 views

I have a .NET 6 console app. Program.cs code: using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.Threading; using ...
ahdung's user avatar
  • 409
0 votes
1 answer
144 views

I'm trying to implement email background service based on IHostedService. But I get this error: System.AggregateException: 'Some services are not able to be constructed (Error while validating the ...
Umut Konmus's user avatar
1 vote
0 answers
68 views

I have a .net Project which needs to run custom logic on Cron. Here's my Code: builder.Services.AddHangfire(configuration => configuration .SetDataCompatibilityLevel(CompatibilityLevel....
Jaspreet Singh's user avatar
0 votes
0 answers
28 views

I have a .NET 6 project with a large number of classes that inherit from IHostedService. All of them receive two input parameters: Config config and LogManager logManager. Are there any ready-made ...
Ghist ghostov's user avatar
2 votes
1 answer
270 views

This is my Program.cs var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); builder.Services.AddTransient<DatabaseSeeder>(); builder.Services.AddScoped<...
semisweetdude's user avatar
1 vote
2 answers
556 views

Is it possible to add an IHostedService to an IHost after calling HostApplicationBuilder.Build() and IHost.StartAsync()? The application needs to be able to load plug-ins during use and have services ...
PatrickV's user avatar
  • 2,145
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.4k
1 vote
0 answers
82 views

I want to add notifications at certain intervals using BackgroundService, but the waiting interval I set is 10 seconds in this example, the program running ends when it is finished. Service like this: ...
Bedirhan Gündöner's user avatar
1 vote
1 answer
2k views

I'm just learning Quartz.NET (and C# in general in fact) and I'm struggling to get my head around the differences between the AddQuartz and AddQuartzHostedService methods. From what I've seen here, ...
Elon Obama's user avatar
0 votes
0 answers
370 views

We have a framework upon which my team builds microservice apps and related jobs. We want to migrate it from using IWebHost for web apps and IHost for jobs to simply using IHost for both. We haven't ...
bubbleking's user avatar
  • 3,641
0 votes
1 answer
922 views

I have used the Worker Service template generated by Visual Studio 2022 as an example, but basically I was wondering what would be a method for finding out the result of a worker run once it is ...
danrockcoll's user avatar
0 votes
1 answer
511 views

I'm having trouble with getting my hosted service to run automatically (without a user initiating a request) on IIS 10. This is an asp.net app, .NET 7 with a React front-end. It's running Signal R and ...
lsonnen's user avatar
1 vote
1 answer
622 views

I'm currently working on a small demo project for a dotnet console application using the generic hosting for logging and configuration. In the context of writing this demo / proof of concept app I ran ...
oli's user avatar
  • 34
0 votes
1 answer
696 views

I have a website page that needs the option of performing an operation that could take several minutes. To avoid performance issues and time outs, I want to run this operation outside of the HTTP ...
Jonathan Wood's user avatar
1 vote
1 answer
459 views

Suppose I have a number of IHostedService implementations with a ton of dependencies that no WebApi controllers do not have direct nor indirect dependencies, too. Ideally, I like it if could set up an ...
softbear's user avatar
  • 515
0 votes
0 answers
213 views

This is my program.cs using TestEmailTaskScheduler.Controllers; using TestEmailTaskScheduler.Models; using System.Configuration; var builder = WebApplication.CreateBuilder(args); // Add services to ...
CodingNeeded's user avatar
5 votes
2 answers
4k views

Why is OpenTelemetry .NET not adding a listener for my ActivitySource in a hosted service on generic host? I have some configurations to pass into OpenTelemetry set-up, so I depend on a class MyClass. ...
Coal Chris's user avatar
5 votes
2 answers
5k views

On ASP.NET Core I'm observing a strange behavior, that was actually reported in BackgroundService not shutting down, stoppingToken never set with .net core generic host but without the root cause ever ...
lezebulon's user avatar
  • 8,114
0 votes
0 answers
169 views

I have a dotnet 6 application with an hosted service that runs some scheduled tasks all x-minutes. So far so good, everything working almost perfectly. What I get from time to time is, that the app ...
rst's user avatar
  • 2,764
2 votes
0 answers
687 views

i have done similar Thing in my Project https://andrewlock.net/using-quartz-net-with-asp-net-core-and-worker-services/. i am scheduling all the job at the StartAsync by fetching the job data from Db . ...
GOWTHAM's user avatar
  • 33
2 votes
1 answer
6k views

I'm using .Net Core Background Service to Connect to Kafka and save messages to SQL Server. My Project Structure looks like this: In the Infrastructure Dependency, I have the following code to ...
Unknown Coder's user avatar