Questions tagged [backgroundworker]

BackgroundWorker is a helper class in .NET's System.ComponentModel namespace providing a general implementation of the Event-Based Asynchronous Pattern to manage a worker thread, support cooperative cancellation, and report progress.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

How do I ensure cleanup of a BackgroundWorker thread in C#?

I have an Excel XLL addin built in C# (using ExcelDNA) and one of the tasks it does (upon the user clicking a button) is a call to an external DLL that does a database request that can take a few ...
RobBaker's user avatar
  • 169
0 votes
0 answers
17 views

How to solve FlutterJNI.loadLibrary called more than once?

when I run the project, I am facing the error: W/FlutterJNI( 8009): FlutterJNI.loadLibrary called more than once I/ResourceExtractor( 8009): Found extracted resources res_timestamp-1-1700998719201 W/...
ROSHO official's user avatar
0 votes
0 answers
23 views

Background Location Fetching Issue with Periodic WorkManager in Android

I'm currently working on an Android app where I need to fetch the user's location in the background at regular intervals using the Periodic WorkManager. I have set up a WorkRequest to trigger every 15 ...
Kalpesh Doru's user avatar
0 votes
1 answer
130 views

How to Schedule Periodic Background Tasks in Android 13 and 14 Using WorkManager or Alternatives?

I'm currently developing an Android app, and I need to schedule periodic background tasks to run every hour on devices running Android 13 and 14. I've tried using the WorkManager with ...
Kalpesh Doru's user avatar
1 vote
0 answers
24 views

Async rollout of pods in Kubernetes

Unfortunately I can not find the right way to solve my problem. I have a deployment named ProductWorker in a Kubernetes cluster. This deployment has 4 replicas. The workers are working on tasks that ...
joey's user avatar
  • 43
0 votes
0 answers
63 views

How should I call a delegate from a BackgroundWorker?

I've created a delegate to have a log, the RichTexbox is visible and I want to call the delegate from a BackgroundWorker (DoWork) but is not working. What should I change to this? Public Class Form1 ...
E_Blue's user avatar
  • 1,081
0 votes
0 answers
39 views

Delay Windows Service "Running" State Transition in .NET 6 BackgroundService

I am working on creating a Windows service in .NET 6 using BackgroundService. However, I'm encountering an issue where the Windows service transitions to the "running" state as soon as ...
Jojo Peter's user avatar
0 votes
0 answers
23 views

Use of CouroutineWorker and inject contect

I have followed a tutorial on how to inject repo and context into a Worker in Android but as my call to the repo is using a Coroutine, I have decided to use a CoroutineWorker instead but I cannot have ...
Seb's user avatar
  • 3,015
0 votes
0 answers
24 views

in Android, Periodic work only runs one time and stops after quitting the app [duplicate]

I created a sample Android application to send requests every 12 hours, I used worker class to achieve this, and I implemented like below, for testing purposes I have changed the time to 6 Sec, but ...
FGH's user avatar
  • 3,200
-1 votes
1 answer
126 views

Await async background thread behavior

I'm updating a C# WPF project that previously used a WCF service and now calls REST-based API. The following code is a typical example of a REST API call: public static async Task<List<KBase>&...
Ross Kelly's user avatar
0 votes
0 answers
36 views

How can import modules in dist folder in background.js?

I'm currently working on a chrome extension to record meet meeting and i'm using webRTC to do so. So i created the whole thing but discovered webRTC was not recording when the pop-up was closed so i ...
Trigonis's user avatar
-1 votes
1 answer
111 views

how to make background service run in iis even if iis is idle

i am implementing a background service , the problem is when i run it in local it is working fine since the app is hit and running . but in iis i deployed code and started the server in iis. the ...
Jojo fever's user avatar
0 votes
0 answers
19 views

C#, Visual Studio 2022 : how can I access a GeometryModel3D in a Viewport3D to be able to loop within a BackgroundWorker?

Here's the relevant code from the MainWindow class. public partial class MainWindow : Window { readonly Model3DGroup myModel3DGroup = new Model3DGroup(); readonly ModelVisual3D ...
K.P.'s user avatar
  • 67
0 votes
0 answers
23 views

Quartz Job not triggering from IIS Server and not inserting jobs into database

I have done schedule jobs and jobs running on Visual studio 2022 public class NotificationJob : IHostedService { readonly ILogger<NotificationJob> _logger; // private IScheduler ...
oggy oggy's user avatar
0 votes
1 answer
85 views

Azure Redis Cache: Reading is not allowed after reader was completed

I wrote cache-update functionality. Here is my Redis Cache implementation: public class RedisCache : ICache { private readonly IDatabase _cache; public RedisCache(string ...
michasaucer's user avatar
  • 4,667
0 votes
0 answers
43 views

BackgroundWorker reports progress faster than the "progress" UI can update itself

I have a Windows Forms app that uses a BackgroundWorker component to run a number of SQL commands, read from a script. The number of commands and their performance can vary greatly, so I can't predict ...
Ann L.'s user avatar
  • 13.8k
0 votes
2 answers
72 views

Shared SignalR HubConnection for multiple BackgroundServices in .NET

My .NET BackgroundService application have multple workers and all of them connects to the same SignalR Hub. Each worker gets a unique ConnectionId which will not work in my case. How, if possible, ...
linusdev's user avatar
0 votes
0 answers
68 views

SentryEventProcessors not working with ASP.NET and Serilog using ILoggerFactory

After upgrading the Sentry NuGet packages from v3.22.0 to v3.23.1 in my ASP.NET application, I'm experiencing issues with the event flow and processors of Sentry in background contexts such as ...
Jonathan Tauan's user avatar
0 votes
0 answers
56 views

How to trace background job ( backburner ) by opentelemetry

I try to trace background job by open telemetry like following code # opentelemetry.rb MyAppTracer = OpenTelemetry.tracer_provider.tracer('admin-export-tracer') # others code MyAppTracer.in_span(&...
Jerry Fang's user avatar
1 vote
2 answers
196 views

BluetoothLeScanner running in a background worker class works on Android 9 device but does not work on Android 13 device

I use jetpack WorkManager to schedule a BLEScanWorker class to scan for BLE devices in the background every 15 minutes. BLEScanWorker scans BLE devices for 10 sec each time and saves the discovered ...
user22020238's user avatar
0 votes
0 answers
127 views

How to get Windows Active Window Handle using a Background Worker Service

I'm developing a simple Background Worker service to run as a Windows service following this example. The service will periodically log if certain applications are actively running on the users ...
Samer's user avatar
  • 21
0 votes
1 answer
67 views

Multiple iterations in Progress Bar C# WinForms

I have two classes - form and functions. Function class consists of, unexpectedly, functions, and there are many of them (let's say 20). They all use different algorithms and external libraries, but ...
user avatar
2 votes
2 answers
644 views

Background Service in .net core 3 that will wait for jobs to be processed from JobQueue table in the Database

We have to expose a Web API with methods that will perform bulk operations like insert , update and delete, now for example the client will send a request to Create method in the API and they can send ...
Che10's user avatar
  • 21
0 votes
1 answer
209 views

How can I get multiple historical data requests from Interactive Brokers (IB) C# sample app. (threading UI problems, background threads)

I think this problem requires and understanding of how Interactive Broker's C# sample app that comes with the API works. I am trying to modify IB's sample C# app that comes with the API to request ...
quinn's user avatar
  • 307
0 votes
1 answer
176 views

How to initiate a process only once in .NET Core Background service ExecuteAsync

We have a background service that listens for events coming in different message queues. The service was created using VS template for worker service, and implements BackgroundService. I need to make ...
joym8's user avatar
  • 4,044
0 votes
1 answer
726 views

How to log when background service stopped using ExecuteAsync method

I am using .NET 7 and in that I am implementing BackgroundService. While implementing BackgroundService I want to log when service started and when service stopped. But I am not able to log when ...
Abhay Singh's user avatar
0 votes
1 answer
38 views

How do I update a single instance of an inherited form without updating the other open instances?

Edited 3/23 to include suggested changes and new information. I have a vb.net Windows form, rptBase, with a statusstrip and a ToolStripStatusLabel tssl1. Two forms, rpt1 and rpt2, inherit rptBase. On ...
KMcHenry's user avatar
1 vote
1 answer
416 views

Accessing scoped DbContext in singelton hosted service

I can't simply inject the DB context so I have to rely on injecting IServiceScopeFactory and obtain it from the registered services like this. AppDbContext Context() { using IServiceScope scope = ...
Konrad Viltersten's user avatar
0 votes
1 answer
470 views

Writing a Background Message Service for .NET MAUI Blazor App IOS

I try to program an application for Apple IOS. I use a .NET MAUI Blazor App for this project, because our whole development is in C#. What I want to do: I want to receive messages from a MQTT Server. ...
Stottis's user avatar
  • 33
0 votes
1 answer
14 views

Why my aplication doesn't LoadAndCompleteInstance after some execution using BackgroundWorker?

using (var bgw = new BackgroundWorker()) { bgw.DoWork += delegate { ...
pely's user avatar
  • 1
-2 votes
2 answers
204 views

Fill DataGridView using Background worker - cross-thread operation not valid Control accessed from a thread

In c# winforms application I have datagridview with two dates start date and end date. I need to fill datagridview within the range of date. It takes a lot of time to fill the datagridview and windows ...
gok's user avatar
  • 1
0 votes
0 answers
41 views

This Invoke isn't executed and somehow just closes my backgroundworker. Why?

Greetings fellow citicens, recently I startet using C# and there still are quite a few things I have to figure out. Currently I have to debug a chaotic old winforms project of a former colleague and ...
Mijira's user avatar
  • 1
-1 votes
1 answer
80 views

WPF .Net update Progress Bar while loading Classes

I am creating a WPF MVVM Application where I have a Main Window and different Pages displayed in a Frame. I want to add a Loading Screen with a Progress Bar which updates while the Instances for the ...
CarMaster4451's user avatar
0 votes
1 answer
49 views

How can I fix my backgroundworker getting progressively slower in VB.NET?

I'm working on a software that adds lines of text to different files. It uses a backgroundworker for that matter. Recently I noticed that the process of adding text gets progressively slower over time....
Seeloewen's user avatar
-1 votes
1 answer
179 views

Running recurrency tasks in Flutter when application is in background

WorkManager allows us to run recurring background tasks, but not more often than 15 minutes. I would like to run the background task in every minute.
birdemic's user avatar
2 votes
0 answers
2k views

Why background service is not working as a service but works as an executable?

I have created a background service in C#. Last week I moved it to my virtual machine, I created a service as sc.exe create NameOfService binPath= blabla and worked perfectly until Sunday (yesterday 2/...
Paul Viorel's user avatar
0 votes
0 answers
284 views

How to start my Background service by button click

I have a requirement: if I click button the background service will start what I have to do for this .Basically it is an ASP.NET MVC project public class TimeHostedService : IHostedService, ...
uday shankar's user avatar
-3 votes
1 answer
92 views

Background worker Is busy error and I want to implement in progress bar

private void button1_Click(object sender, EventArgs e) { //progress bar backgroundWorker1.RunWorkerAsync(); progressBar1.Value = 1; progressBar1.Minimum = 1; progressBar1.Maximum = ...
samccxr's user avatar
0 votes
0 answers
180 views

What is the correct way of mounting appsettings file for .Net Core Worker Service?

I have a .Net Worker service that runs as a K8S Cronjob but when it starts up it is failing to mount the appsettings file. The pod remains stuck in CrashLoopBackoff error state and the logs have the ...
Golide's user avatar
  • 915
0 votes
0 answers
29 views

Disable lifetime application logging from a BackgroundService in .NET 7

I want to remove messages such as "Application started. Hosting environment: Production; Content root path: ..." or "Application is shutting down" from my .NET 7 windows service. I ...
Yanis's user avatar
  • 3
0 votes
0 answers
47 views

The main form freezes even though I use a BackgroundWorker and Control.Invoke()

In the following source code, I am loading 20 CSV files (Each CSV file has 1000000 rows and three columns) and drawing 20 plots using ZedGraph. I am using BackgroundWorker to generate plots. ...
user366312's user avatar
0 votes
0 answers
62 views

Process.Start("chrome.exe","url") not working on Dotnet worker service after service hosted on windows

I have Dotnet core Worker Service application in the version 6.0. I am trying to open a website using System.Diagnostics.Process. it is working fine when I am in debugging mode on visual studio, when ...
Karan Ekkawala's user avatar
0 votes
1 answer
62 views

Long running service for scheduled jobs in .NET 6

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
0 votes
0 answers
442 views

Blazor Server run only one background task

I have a Blazor Server application (net 7) where a long running background task can be triggered by any user, but once the task has been started everyone must wait until that task is completed. The ...
Sam's user avatar
  • 826
0 votes
1 answer
117 views

The configured execution strategy 'SqlRetryingExecutionStrategy' does not support user-initiated transactions

I have ASP.Net 4.7.2 window service which is processing NServiceBus messages. Currently it is deployed to On-Premise server. It has retry mechanism as well and working fine. Now I am going to ...
Jainav Surana's user avatar
0 votes
0 answers
102 views

send notification from background worker

am using ABP to build my project I have a module to generate big size files using background worker, and after each successful file generated I need to send notification, but is not working ! I've put ...
Mohammed Alzamil's user avatar
0 votes
0 answers
85 views

Why is it not possible to delete files quickly (<60s) across threads in aspnet?

I get error System.IO.IOException: 'The process cannot access the file 'xxx' because it is being used by another process.' when I try to delete a temp file in a background worker service in aspnet ...
jakob gaardsted's user avatar
1 vote
1 answer
117 views

Backgroundworker and Task.Run have a big delay before action

Have 1 main BackgroundWorker and many of other. In time of starting other workers in main worker Task.Run not running in expected time. How to modify code to do all tasks(or threads) parallel? static ...
Dennis V's user avatar
1 vote
2 answers
525 views

WPF Application UI freezing despite collection view source being updated by a background worker

I have an app that retrieves data from a database and displays it in data grid on the main window. The maximum number of items being displayed is ~5000. I don't mind a time delay in display the ...
dancolewye's user avatar
1 vote
1 answer
859 views

C# .NET BackgroundWorker 6 FileSystemWatcher The process cannot access the file "PATH" because it is being used by another process

I'm trying to watch a directory for newly added files ending in .csv do something with them, delete the file and wait for a newly added file to do process the file again. I'm using a BackgroundService ...
Pauldb's user avatar
  • 261

1
2 3 4 5
70