Base solution for your next web application
Open Closed

Hangfire Exception: Async void methods are not supported #4090


User avatar
0
ajayak created

I switched to Hangfire for BackgroundJob. On enqueuing a background job, I get this error

Async void methods are not supported. Use async Task instead.

Here is the code:

public override async void Execute(long userId)
        {
            await DeleteWebhooks(userId);
        }

It works fine with default BackgroundJob manager


1 Answer(s)