2

I've been experimenting with Hangfire today. It looks like a cool product. Unfortunately, my environment is not the most up-to-date. I have VS 2010, .Net 4.0 and SQLServer 2005. I created a new project and installed Hangfire, Hangfire.Core, Hangfire.NET40.SQLServer, OWIN and who knows what else. The project now has no errors. All references are resolved.

I got a lot of insight from here at StackOverflow and attempted to configure the Startup Class as instructed.

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

I also created a new SQL User and empty database for Hangfire to use. In the Web.Config file I added this connection string:

<add name="SQLServer" 
     connectionString="Server=SQLServer;Database=Hangfire;User Id=HangfireAPI;Password=********;" />

I think I've covered all the bases but at runtime the call to UseSqlServerStorage returns an error:

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.

I've searched without success for the file 'NoOpLogger.cs'. Since my project is VB, I'm not sure why or how this is coming up.

I'd appreciate help on this one.

Community
  • 1
  • 1
Ebassador
  • 339
  • 3
  • 20
  • `NoOpLogger` is part of `Common.Logging`. It literally does nothing (a no op). What is the error you're getting? the above just says what file it's looking for, not the actual error. It's likely either misconfigured logging, or an attempt to log an error is causing a further error – Simon Halsey Oct 10 '14 at 21:59
  • Column, parameter, or variable #5: Cannot find data type datetime2. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Column, parameter, or variable #5: Cannot find data type datetime2. – Ebassador Oct 10 '14 at 22:02

1 Answers1

3

Hangfire uses features that are not compatible with VS 2010 and SQL 2005. See this StackOverflow article which identifies the core issue. DateTime2 is not a valid type in SQL 2005!

Community
  • 1
  • 1
Ebassador
  • 339
  • 3
  • 20