Scheduling Recurring Job on Application Startup throws Invalid object Name 'Hangfire.Hash' Exception


#1

I am trying to schedule a recurring job in either the Application_Start of Global.asax or even in the Owin startup class but seem to be getting an exception. The exception appears to be a sql exception of Invalid Object name 'HangFire.Hash. I have not experienced this issue when scheduling any other background job or recurring job from within my application logic, it appears to be isolated to trying from within these two places in the application lifecycle. Any help in pointing me in the right direction to resolve this would be greatly appreciated.


#2

hello, did u find a solution for that? I have previously used hangfire for my other projects, but im stuck with this error…


#3

Oh i found it. my connection string was targeting a wrong database… :frowning:


#4

I stuck with this problem too… It’s work perfectly in local…
But when I deploy to azure web service

  1. it will occur -> SqlException: Invalid object name ‘HangFire.Hash’.
    So I decide to put Integrated Security=SSPI; in ConnectionString of azure sql then
  2. it occur -> Windows logins are not supported in this version of SQL Server instead.

#5

I am having this same problem on a brand new project. I have PrepareSchemaIfNecessary=True and it’s the same database I used all through testing. It only errors on server deployment.


#6

If your problem is same with me, try checking if it has the Hangfire database on server deployment.


#7

I had this problem, when i don’t add migration with hangfire models.