Thanks for the detailed information!
HangFire uses JobActivator
class to create instances of your classes, in your example it is the FileImportController
. Default JobActivator
implementation can construct only classes with default constructors, and this is the default behavior for ASP.NET MVC’s dependency resolver either.
To be able to use non-default constructor, you should empower HF with the IoC container:
If you are using another IoC container, don’t worry, just implement its support by example, and use it in your code JobActivator.Current = new YourImplementation()
.
P.S. You can fix this, re-build the application and try the Retry
button on a previously failed job.