簡體   English   中英

不支持的關鍵字:“元數據”。 在 Hangfire

[英]Keyword not supported: 'metadata'. in Hangfire

我在 asp.net mvc 應用程序中工作,我想設置用戶請求的提醒,在 startup.cs 類中我配置了 hangfire。但它給出了異常,不支持關鍵字:“元數據”。 當閱讀這行代碼時 GlobalConfiguration.Configuration.UseSqlServerStorage("DbEntities");

using Hangfire;
using Hangfire.SqlServer;
using Microsoft.Owin;
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using UKC.Data.Infrastructure;
using UKC.UI.Helper;

[assembly: OwinStartup(typeof(UKC.UI.App_Start.Startup))]
namespace UKC.UI.App_Start
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
            GlobalConfiguration.Configuration
               .UseSqlServerStorage("DbEntities");

        }
    }
}

在我的例子中,這是因為配置文件中的連接字符串不正確。

        <add name="HangfireEntities" connectionString="metadata=res://*/Model.DBModel.csdl|res://*/Model.DBModel.ssdl|res://*/Model.DBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=localhost;initial catalog=HangfireTest;persist security info=True;user id=sa;password=myStrongPassw0rd;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

應該

<add name="HangfireEntities" connectionString="Server=.\\localhost; Database=HangfireTest;user id=sa;password=myStrongPassw0rd" providerName="System.Data.EntityClient" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM