在visual studio mac中寻找有关hangfire的帮助。”这是一个webapi项目,在windows/iis上工作。
在启动过程中,hangfire被初始化。一旦发生这种情况,我们会尝试设置一个重复的作业。当连接到Windows上的SQL Server 2014或Linux上的SQL Server 2019 CTP时,会引发异常。
{System.Transactions.TransactionAbortedException: Transaction failed ---> System.ObjectDisposedException: Cannot access a disposed object. Object name: 'SqlDelegatedTransaction'. at System.Data.SqlClient.SqlDelegatedTransaction.GetValidConnection () [0x0000a]â¦}
当连接到azure sql时,它返回
{System.NotImplementedException: The method or operation is not implemented. at System.Transactions.Transaction.EnlistPromotableSinglePhase (System.Transactions.IPromotableSinglePhaseNotification promotableSinglePhaseNotification, System.Guid promoterType)
尝试了HangFire 1.6.8(适用于Windows)、1.6.14和1.6.21。
调用时引发错误
BackgroundJob.Enqueue
或
RecurringJob.AddOrUpdate
.
为了简化这一点,我实现了一个简单的函数,而不是我们的函数,这也失败了。
例如
BackgroundJob.Enqueue(() => Console.Write("Enqueue"));
任何帮助都将不胜感激!