我今天一直在尝试使用Hangfire。它看起来像一个很酷的产品。不幸的是,我的环境并不是最新的。我有VS 2010,.Net 4.0和SQLServer 2005.我创建了一个新项目并安装了Hangfire,Hangfire.Core,Hangfire.NET40.SQLServer,OWIN以及谁知道还有什么。该项目现在没有错误。所有参考文献都已解决。
我从here at StackOverflow获得了很多见解,并尝试按照指示配置启动类。
Public Sub Configuration(app As IAppBuilder)
app.UseHangfire(
Sub(config)
' Basic setup required to process background jobs.
config.UseSqlServerStorage("SQLServer")
config.UseServer()
End Sub)
End Sub
我还为Hangfire创建了一个新的SQL用户和空数据库。在Web.Config文件中,我添加了这个连接字符串:
<add name="SQLServer"
connectionString="Server=SQLServer;Database=Hangfire;User Id=HangfireAPI;Password=********;" />
我认为我已经覆盖了所有基础但在运行时调用UseSqlServerStorage会返回错误:
Locating source for 'c:\_oss\common-logging\src\Common.Logging.Core\Logging\Simple\NoOpLogger.cs'. Checksum: MD5 {7d f3 26 f7 66 5a 52 54 72 fe 23 b9 2 c1 cd 50}
The file 'c:\_oss\common-logging\src\Common.Logging.Core\Logging\Simple\NoOpLogger.cs' does not exist.
Looking in script documents for 'c:\_oss\common-logging\src\Common.Logging.Core\Logging\Simple\NoOpLogger.cs'...
Looking in the projects for 'c:\_oss\common-logging\src\Common.Logging.Core\Logging\Simple\NoOpLogger.cs'.
The file was not found in a project.
我没有成功搜索文件&#39; NoOpLogger.cs&#39;。由于我的项目是VB,我不确定为什么或如何出现。
我很感激这方面的帮助。
答案 0 :(得分:3)
Hangfire使用与VS 2010和SQL 2005不兼容的功能。请参阅此StackOverflow article以确定核心问题。 DateTime2不是SQL 2005中的有效类型!