System.IO.FileNotFoundException for RecurringJob
Closed this issue · 2 comments
If I create a repeating task that calls a method with a tag, this error crashes and the task is not created at all. Although the table [Set] tag values are written.
System.IO.FileNotFoundException
Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Hangfire.Tags.SqlServer.SqlTagsTransaction.PersistSetValue(String key, String value)
at Hangfire.Tags.Storage.TagExpirationTransaction.Persist(String jobid)
at Hangfire.Tags.States.TagsCleanupStateFilter.OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction)
at Hangfire.States.StateMachine.InvokeOnStateApplied(Tuple`2 x)
my jos is:
RecurringJob.AddOrUpdate(
() => new HangfireCore.Processes.ShopsProcesses().ShopSalesJobsStart(10, false),
"*/5 * * * *", TimeZoneInfo.Local);
Ah, I see that there is a difference in dependencies. Hangfire.SqlServer depends on System.Data.SqlClient version 4.4.0.0, and Hangfire.Tags.SqlServer does not directly depend on System.Data.SqlClient, but uses code from that assembly.
I've just pushed a new version with a dependency to System.Data.SqlClient, which should solve the issue. If it doesn't, add a reference to System.Data.SqlClient to the project that also references Hangfire.Tags.SqlServer.