hangfire无法加载文件或程序集'DynamicProxyGenAssembly2 [英] hangfire Could not load file or assembly 'DynamicProxyGenAssembly2

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

问题描述

我已经按照以下步骤设置了Hangfire:

I have setup Hangfire as below:

 var t = IocManager.Resolve<TestJob>();

 RecurringJob.AddOrUpdate("sendDailyEmail",() => t.sendEmail(), Cron.Daily);

当我访问Hangfire仪表板时,可以看到重复执行的作业1",但是该作业没有执行,并且出现此错误:

When I access the Hangfire dashboard, I can see the Recurring Jobs 1, but the job is not executed and I get this error:

无法加载文件或程序集'DynamicProxyGenAssembly2,版本= 0.0.0.0,区域性=中性,PublicKeyToken =空'或其依赖项之一.系统找不到指定的文件.

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

我的设置有什么问题?

推荐答案

可能与您的上下文不同,但我认为仍然值得在此处添加它:
-Hangfire服务器正在作为Windows服务运行;
-在ASP.NET MVC 5应用程序上运行的Hangfire仪表板;
-jobs实际上正在运行,但仪表板始终显示FileNotFoundException;

Might not be the same context as yours but I think it's still worth adding it here:
-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;

解决方案::添加了对仪表板Web应用程序中缺少的程序集(即"DynamicProxyGenAssembly2")的引用.

Solution: added a reference to the missing assembly (ie: 'DynamicProxyGenAssembly2') in the dashboard web app.

@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无法加载文件或程序集'DynamicProxyGenAssembly2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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