Hangfire无法加载程序集 [英] Hangfire failes to load assembly

查看:683
本文介绍了Hangfire无法加载程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文

我有两个应用程序,一个是我的主要企业应用程序,另一个是我托管的hangfire(hangfire服务器,客户端和仪表板).我的主应用程序还对某些较长的任务使用hangfire并异步执行它们.两者都使用相同的数据库进行HF存储.而且只有一台HF服务器.

I have two application in place, one is my main enterprise application and in other I have hangfire (hangfire server, client and dashboard) hosted. My main application also use hangfire for some long task and executes them asynchronously. Both using the same DB for HF storage. And there is only one HF server.

问题

我间歇性地遇到以下错误-

I am getting the following errors intermittently -

无法将状态更改为正在处理":找不到目标方法." 或

"Can not change the state to 'Processing': target method was not found." OR

无法将状态更改为'已入队':未找到目标方法."

"Can not change the state to 'Enqueued': target method was not found."

具有以下详细信息-

System.IO.FileNotFoundException

System.IO.FileNotFoundException

无法加载文件或程序集'MyApp.Hangfire,版本= 1.0.0.0, 文化=中性,PublicKeyToken =空"或其依赖项之一.这 系统找不到指定的文件.

Could not load file or assembly 'MyApp.Hangfire, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

其中 MyApp.Hangfire 是我的执行任务的hangfire应用程序.而且我确信它在那里,甚至一些成功的工作也肯定了它.

where MyApp.Hangfire is my hangfire application executing jobs. And I am sure that it is there, and even some successful jobs affirms it.

请找到随附的屏幕截图以获取更多详细信息.

观察

问题不一致,作业并非总是失败,有时失败,重新排队并通过,有时甚至在重试时失败. 如屏幕截图所示

The issue is not consistent, the job not always fails, sometimes it fails, re queued and get passed and sometimes when it is out of retries it even fails. As shown in screenshot

推荐答案

几天前,我偶然发现了同一个问题,并认为值得在此处添加它.
解决方案:在仪表板Web应用程序中添加了对"MyApp.Hangfire"的引用.

I've stumbled upon the same issue a few days ago and decided it's worth adding it here.
Solution: added a reference to 'MyApp.Hangfire' in the dashboard web app.

上下文与您的上下文非常相似或相同:
-Hangfire服务器正在作为Windows服务运行;
-在ASP.NET MVC 5应用程序上运行的Hangfire仪表板;
-jobs实际上正在运行,但仪表板始终显示FileNotFoundException;

Context was very similar or identical to yours:
-Hangfire server was running as a Windows service;
-Hangfire dashboard running on top of a ASP.NET MVC 5 app;
-jobs were actually running but dashboard kept displaying a FileNotFoundException;

@reggieboyYEAH 以相同的方式报告并解决了相同的问题. .
此处的详细信息: https://github.com/HangfireIO/Hangfire/issues/558

Same problem was reported and solved in the same way by @reggieboyYEAH.
Details here: https://github.com/HangfireIO/Hangfire/issues/558

这篇关于Hangfire无法加载程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆