我在.net-6.0中使用Hangfire和Postgresql Storage并安装此软件包:Hangfire.PostgreSQL版本1.9.10
这是My Code In Program.cs:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHangfire(config => config.UsePostgreSqlStorage(builder.Configuration.GetConnectionString("HangfireConnection")));
builder.Services.AddHangfireServer();
var app = builder.Build();
app.UseHangfireDashboard();
这是webconfig中的My Connection字符串:
"ConnectionStrings": {
"HangfireConnection": "Host=db1.motorazmasamin.com;Port=***;Database=Hangfire;Username=***;Password=***"
},
当键入Dashboard URL(http://localhost/hangfire)时,返回此错误:
{“data”:null,“status”:-1,“message”:“42601:“value”处或附近的语法错误\r\n\r\n位置:59”,“statusCode”:“500”}
Show Error Image in Visual Studio
但是当把连接字符串改为SQL Server,把包改为Hangfire.SqlServer时,是正确的!
1条答案
按热度按时间2w2cym1i1#
这是1.9.10的一个bug。以下是一些细节https://github.com/hangfire-postgres/Hangfire.PostgreSql/pull/280/files