PerformingContext is null

queues
Tags: #<Tag:0x00007f6a016fcf30>

#1

When i am passing PerformingContext as parameter in method it is always null. I am using version 1.6.17

Method signature :

[AutomaticRetry(Attempts = 0)]
public void UserChatHistory(int userId, int chatId, int maxId, Guid jobId, PerformingContext hangfireContext)

Init:

BackgroundJob.Enqueue<GetMessages>(gm => gm.ChatHistory(command.CurrentUserId, command.ChatId, int.MaxValue, jobId, null));

Configuration :

GlobalConfiguration.Configuration.UseActivator(new ContainerJobActivator(HangfireIocConfig.RegisterDependencies()));
GlobalConfiguration.Configuration.UseSqlServerStorage(ConfigKeys.HangfireConnectionString);
app.UseHangfireDashboard();
app.UseHangfireServer();

Unfortunately PerformingContext cannot be resolved by autofac when instance of GetMessages is created.
At first I thought this is because i am using Autofac but i have commented this line
GlobalConfiguration.Configuration.UseActivator(new ContainerJobActivator(HangfireIocConfig.RegisterDependencies()));
and nothing changed :frowning:


#2

I finally find out what was wrong with my code.
PerformContext should be passed not PerformingContext :blush: