Does Hangfire work with SQL Server under Mono? I’m having quite a bit of trouble trying to get it going. First if I try to use the CreateSchemaIfNeeded option, Mono’s TDS handler fails and times out. After removing that part, I can’t enqueue a job, as it tries to enlist in a transaction and fails:
Hangfire.Client.CreateJobFailedException: Job creation process has bee failed. See inner exception for details ---> System.NotSupportedException: Operation is not supported.
at System.Data.Common.DbConnection.EnlistTransaction (System.Transactions.Transaction transaction) [0x00000] in <filename unknown>:0
at Hangfire.SqlServer.SqlServerWriteOnlyTransaction.Commit () [0x00000] in <filename unknown>:0
at Hangfire.States.StateChangeProcess.ApplyState (Hangfire.States.ApplyStateContext context, IEnumerable`1 filters) [0x00000] in <filename unknown>:0
at Hangfire.States.StateChangeProcess.ChangeState (Hangfire.States.StateContext context, IState toState, System.String oldStateName) [0x00000] in <filename unknown>:0
at Hangfire.States.StateMachine.CreateInState (Hangfire.Common.Job job, IDictionary`2 parameters, IState state) [0x00000] in <filename unknown>:0
at Hangfire.Client.CreateContext.CreateJob () [0x00000] in <filename unknown>:0
at Hangfire.Client.JobCreationProcess+<>c__DisplayClass9.<CreateWithFilters>b__6 () [0x00000] in <filename unknown>:0
at Hangfire.Client.JobCreationProcess.InvokeClientFilter (IClientFilter filter, Hangfire.Client.CreatingContext preContext, System.Func`1 continuation) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Hangfire.BackgroundJobClient.Create (Hangfire.Common.Job job, IState state) [0x00000] in <filename unknown>:0
at Hangfire.BackgroundJobClientExtensions.Create (IBackgroundJobClient client, System.Linq.Expressions.Expression`1 methodCall, IState state) [0x00000] in <filename unknown>:0
at Hangfire.BackgroundJobClientExtensions.Enqueue (IBackgroundJobClient client, System.Linq.Expressions.Expression`1 methodCall) [0x00000] in <filename unknown>:0
at Hangfire.BackgroundJob.Enqueue (System.Linq.Expressions.Expression`1 methodCall) [0x00000] in <filename unknown>:0
at hftest.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
I’m using SQL Server 2012. I’d be happy to provide a test system, or try to fix the code myself. I’d just like to know what the official line is on Mono support or any hints on what I can do to make it work.
There seems to be a Hangfire.Mono VS SLN file, but I don’t see any Mono-specific code there, just build support.