postgresql 如何修复:42601:当尝试访问Hangfire Jmeter 板时,在“value”处或附近出现语法错误

yvfmudvl  于 2023-06-22  发布在  PostgreSQL
关注(0)|答案(1)|浏览(141)

我在.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时,是正确的!

相关问题