Questions tagged [hangfire-unity]

6 questions
5
votes
1 answer

How to configure hangfire with unity?

I have ASP.NET Web API application. The application is using Unity as IoC container. The application is also using Hangfire and I am trying to configure Hangfire to use Unity. So based on documentation i am using Hangfire.Unity which registers…
LP13
  • 30,567
  • 53
  • 217
  • 400
4
votes
1 answer

Hangfire does not log exception using configured Logger

As per the hangfire documentation Starting from Hangfire 1.3.0, you are not required to do anything, if your application already uses one of the following libraries through the reflection (so that Hangfire itself does not depend on any of …
LP13
  • 30,567
  • 53
  • 217
  • 400
2
votes
1 answer

Resolution failed with error: No public constructor is available for type IHttpContextAccessor

I recently upgraded my app to .net core 6 and now I am getting this error when trying to get a service using this code: IUnityContainer container = HangfireUnityConfig.GetConfiguredContainer(); var authService = container.Resolve(); I…
2
votes
3 answers

How to inject the correct concrete class into a closed sytstem

Hangfire looks to be pretty slick. However, I am having a challenge getting Hangfire to activate the correct concrete class. Some background: public interface IJob { bool Execute(string payload); } public interface IJobPayload { string…
Keith Barrows
  • 24,802
  • 26
  • 88
  • 134
1
vote
0 answers

No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method

I recently upgraded my app to .net core 6 and now I am getting this error on this.ChangeTracker in my code: public ApplicationDbContext(DbContextOptions options) : base(options) { _options = options; …
jonv562
  • 293
  • 1
  • 4
  • 23
0
votes
1 answer

Disposing dependencies in ASP.NET application with Hangfire

Typically in my ASP.NET MVC application that uses Unity as dependency framework i use PerRequestLifetimeManager which disposes all the dependencies when HTTP request completes. Now i configured Hangfire into ASP.NET application. Hangfire schedules…
LP13
  • 30,567
  • 53
  • 217
  • 400