我正在嘗試連接到我的Hangfire service.我的代碼Startup.cs如下所示:services.AddHangfire(configuration => configuration .SetDataCompatibilityLevel(CompatibilityLevel.Version_170) .UseSimpleAssemblyNameTypeSerializer() .UseRecommendedSerializerSettings() .UseSqlServerStorage(Configuration.GetConnectionString("HangfireConnection"), new SqlServerStorageOptions { CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), QueuePollInterval = TimeSpan.Zero, UseRecommendedIsolationLevel = true, UsePageLocksOnDequeue = true, DisableGlobalLocks = true })); services.AddHangfireServer();根據(jù)文檔,Hangfire 1.7 必須built ib sql query創(chuàng)建數(shù)據(jù)庫。我從文檔中創(chuàng)建默認連接字符串:"HangfireConnection": "Server=.\\sqlexpress; Database=Hangfire; Integrated Security=SSPI;"但是當我運行我的應用程序時,我收到此錯誤:System.Data.SqlClient.SqlException:'無法打開登錄請求的數(shù)據(jù)庫“Hangfire”。登錄失敗。用戶“DESKTOP-FOVJ16Q\Michal”登錄失敗我的SecuritySQL Server Express 選項卡如下所示:您能告訴我,我可以檢查什么來連接我的 SQL Server Express?
SQL Server Express 與 Hangfire 連接問題:用戶登錄失敗
幕布斯7119047
2023-07-09 16:44:55