I am using Hangfire in an ASP.NET MVC5 application to send an email. Until now, it was working fine, but now when I run the application, it is throwing this error:
There is already an object named 'Job' in the database.nstalling Hangfire SQL objects... Database schema [HangFire] already exists Table [HangFire].[Schema] already exists.. Installing schema version 1
From this error, I understood that Hangfire trying to create all those tables in the database which are already there. But I'm not getting reason behind it because till now application was working fine, even when I run it locally many times.
HangFire. AspNetCore HangFire into the application. The web application has a database for the application's data. And by default, the HangFire database tables were created in the same database where the application's data resides.
Hangfire. An easy and reliable way to perform fire-and-forget, delayed and recurring, long-running, short-running, CPU or I/O intensive tasks inside ASP.NET applications. No Windows Service / Task Scheduler required. Even ASP.NET is not required. Backed by Redis, SQL Server, SQL Azure or MSMQ.
This happened to me and I run this query and restart the server. Just run the query:
INSERT INTO [HangFire].[Schema]
([Version])
VALUES
(5)
I got that problem after export\import the database via .bacpac finished with errors. I removed all my hangfire tables on development database and it worked (careful, do not do that on production DB).
DROP TABLE IF EXISTS HangFire.AggregatedCounter
DROP TABLE IF EXISTS HangFire.Counter
DROP TABLE IF EXISTS HangFire.Hash
DROP TABLE IF EXISTS HangFire.JobParameter
DROP TABLE IF EXISTS HangFire.JobQueue
DROP TABLE IF EXISTS HangFire.List
DROP TABLE IF EXISTS HangFire.[Schema]
DROP TABLE IF EXISTS HangFire.Server
DROP TABLE IF EXISTS HangFire.[Set]
DROP Table IF EXISTS HangFire.State
DROP TABLE IF EXISTS HangFire.Job
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With