We were upgrading our implementation to 1.5.0 version and all went well. Then noticed 1.5.1 version and decided to give it a try. However it started giving ‘Can not find the target method’ errors on Jobs that are being created for Interface methods. It was working when implementation methods were used. Switched back to 1.5.0.
> Error:
> _hangfireClient.Enqueue<IRemoteStorer>(x => x.StoreRemotely(document.DocumentId));
> OK:
> _hangfireClient.Enqueue<RemoteStorer>(x => x.StoreRemotely(document.DocumentId));
> Our enqueue is:
> public class HangfireClient
> ...
> IBackgroundJobClient _jobClient;
> ...
> public virtual string Enqueue<T>(Expression<Action<T>> methodCall)
> {...
> return _jobClient.Create(methodCall, new EnqueuedState
> {
> Queue = _queueName
> });
Actual log error from BackgroundJob:
2015-10-15 12:47:19,360 [DelayedJobScheduler] WARN Hangfire.AutomaticRetryAttribute - Failed to process the job '2': an exception occurred. Retry attempt 2 of 10 will be performed in 00:00:28.
System.InvalidOperationException: The type `...IRemoteStorer` does not contain a method with signature `StoreRemotely(Guid)`
at Hangfire.Storage.InvocationData.Deserialize()
public interface IRemoteStorer
{
void StoreRemotely(Guid documentId);
}