Questions tagged [hangfire-autofac]

Hangfire.Autofac is a Hangfire job activator based on the Autofac Inversion of Control container for Windows/.NET applications.

Hangfire.Autofac is a Hangfire job activator based on the Autofac Inversion of Control container for Windows/.NET applications.

26 questions
12
votes
3 answers

Resolving Hangfire dependencies/HttpContext in .NET Core Startup

I've installed and configured Hangfire in my .NET Core web application's Startup class as follows (with a lot of the non-Hangfire code removed): public class Startup { public void Configuration(IAppBuilder app) { …
mellis481
  • 4,332
  • 12
  • 71
  • 118
5
votes
1 answer

How to get List of all Hangfire Jobs using JobStorage in C#?

I am using Hangfire BackgroundJob to create a background job in C# using below code. var options = new BackgroundJobServerOptions { ServerName = "Test Server", SchedulePollingInterval = TimeSpan.FromSeconds(30), …
prog1011
  • 3,425
  • 3
  • 30
  • 57
4
votes
1 answer

Hangfire is stopping with log caught stopping signal

I have configured Hangfire for my Web API solution. But the Hangfire stops working after sometime logging about stopping signal. However, if API is sit again it loads and works normally. The log produced by Hangfire before stopping is as below. What…
akhilv
  • 69
  • 1
  • 6
3
votes
1 answer

Hangfire With Autofac in WebApi

I have following configuration in startup.cs but I am getting error although I have installed Hangifre.Autofac nuget package and configured. No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was…
SOF User
  • 7,590
  • 22
  • 75
  • 121
2
votes
1 answer

Autofac RegisterAssemblyTypes from tests

In my Startup class I a have method for RegisterAssemblyTypes through autofac as the following: public class Startup { public void ConfigureContainer(ContainerBuilder builder) { builder.RegisterModule(new ApplicationModule()); …
Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
2
votes
1 answer

Autofac.Core.Registration.ComponentNotRegisteredException, FAILED: An exception occurred during processing of a background job

Exception: The requested service 'Mach.CharterPad.Business.TripManager' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the…
awais
  • 492
  • 4
  • 17
2
votes
0 answers

Queuing BankgroundJob with Hangfire within an async action in ASP.NET MVC freeze the application

I have this action on one of my controllers which is called by another method which has been called also by another action. All works fine, unless I try to en-queue with Hangfire some jobs: _bankClient.FetchAndEnsureTransactionsAsync and…
2
votes
1 answer

HangFire Recurring Jobs Fail on server with Autofac.Core.Registration.ComponentNotRegisteredException or No parameterless exception

I've just started using HangFire. The jobs seem to work fine when I run it locally from IIS Express, but when I run it on my dev server I get errors that no parameterless constructor defined. I was using Simple Injector earlier but now I've moved to…
Madhav Shenoy
  • 798
  • 12
  • 32
1
vote
1 answer

How to run Hangfire as a separate process from the main web application?

I am experiencing a big performance hit with Hangfire running on the same app pool as my web application and our site has become terribly slow with CPU sitting at 96% constantly. I have looked at the Hangfire documentation and there is a way to run…
Donald N. Mafa
  • 5,131
  • 10
  • 39
  • 56
1
vote
0 answers

Hangfire Register IoC Dependency in Scope For Job at Run Time

Issue: most jobs are dependent on configuration dependency. Ideal Solution: (copied here and at end just to save reading if you already know exactly how to do this) I would like to during job Q (using filter or any other options) save some data…
1
vote
1 answer

JobActivator in Hangfire doesnt instancelize DataContext for each run of RecurringJob

I am using HangFire and EntityFramework for recurring job public void Start(IContainer container) { GlobalConfiguration.Configuration .UseColouredConsoleLogProvider(LogLevel.Debug) .SetDataCompatibilityLevel(CompatibilityLevel.Version_170) …
Pribina
  • 750
  • 1
  • 7
  • 14
1
vote
2 answers

How can we let recurring job only trigger on one instance in case of scale out

I use Hangfire to read files from FTP server and I have multiple server instances to read from FTP. I need the recurring job only trigger on one instance to prevent the same job to read from same file. var jobId =…
1
vote
1 answer

Hangfire Recurring Job gives ERROR in second execution

I have a recurring job, it works perfectly first time, but after the next execution, it gives ERROR. However, there isn't any exception or error in my GetPendingTrips() method. Can some guide me what is the issue here in next attempt of recurring…
awais
  • 492
  • 4
  • 17
1
vote
2 answers

How do I make Hangfire pick jobs queued in the last hour?

My requirement is to process only latest jobs and ignore older jobs. How do I configure that in Hangfire? I have tried IApplyStateFilter for setting ExpirationAttribute public class ExpirationAttribute : JobFilterAttribute, IApplyStateFilter { …
akhilv
  • 69
  • 1
  • 6
1
vote
0 answers

Can't Enqueue my Job in hangfire server

I am working on enqueue jobs using hangfire in my application. my enqueue job statement is given below, string jobId = BackgroundJob.Enqueue(() => strategy.get(typeof(_service.Engine.Summary), cpdata)); when this will enqueue my job…
npatel
  • 51
  • 1
  • 3
1
2