From 076a99b2fc1eeb3ac29b30f94786c9a763c6bdda Mon Sep 17 00:00:00 2001 From: wufan Date: Tue, 22 Oct 2024 09:05:19 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20nuget=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hangfire.Job/Hangfire.Job.csproj | 9 ++++----- Hangfire.Job/Program.cs | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Hangfire.Job/Hangfire.Job.csproj b/Hangfire.Job/Hangfire.Job.csproj index 3e73d56..5c3b36b 100644 --- a/Hangfire.Job/Hangfire.Job.csproj +++ b/Hangfire.Job/Hangfire.Job.csproj @@ -7,11 +7,10 @@ - - - - - + + + + diff --git a/Hangfire.Job/Program.cs b/Hangfire.Job/Program.cs index aa39236..d0acbb8 100644 --- a/Hangfire.Job/Program.cs +++ b/Hangfire.Job/Program.cs @@ -1,7 +1,6 @@ using Hangfire; using Hangfire.Console; using Hangfire.HttpJob; -using Hangfire.Tags.SqlServer; var builder = WebApplication.CreateBuilder(args); @@ -9,12 +8,13 @@ var builder = WebApplication.CreateBuilder(args); var connectionString = builder.Configuration["ConnectionStrings:Default"]; builder.Services.AddHangfire(config => config + .UseSimpleAssemblyNameTypeSerializer() + .UseRecommendedSerializerSettings() .UseSqlServerStorage(connectionString) - // .UseConsole(new ConsoleOptions() - // { - // BackgroundColor = "#000079" - // }) - // .UseTagsWithSql() + .UseConsole(new ConsoleOptions() + { + BackgroundColor = "#000079" + }) .UseHangfireHttpJob() ); @@ -24,7 +24,7 @@ builder.Services.AddHangfireServer(); var app = builder.Build(); app.UseHangfireDashboard(); -// app.UseHangfireServer(); app.MapGet("/", () => "Hangfire service is running!"); + app.Run(); \ No newline at end of file