【问题标题】:Keyword not supported: 'server' - identityserver不支持关键字:“服务器”-身份服务器
【发布时间】:2020-07-26 07:10:18
【问题描述】:

我正在尝试完成 identityserver4 教程。示例继续使用 sqlite,但我尝试转换为托管在 azure 上的 sqlserver。那时,我遇到了这个错误。

Keyword not supported: 'server'

尽管连接字符串指向 sql server,并且种子方法引用 sqlserver 方法而不是 sqlite,但仍会发生这种情况。

    //services.AddDbContext<ApplicationDbContext>(options =>
    //   options.UseSqlite(connectionString));
    services.AddDbContext<ApplicationDbContext>(options =>
        options.UseSqlServer(connectionString));

[还有其他问题有相同的错误,但这是专门针对身份服务器的]

【问题讨论】:

    标签: asp.net-identity identityserver4


    【解决方案1】:

    我发现,有两个地方引用了sql server。

    与 Seed.cs 文件一起,转到 Startup.cs 文件。你会发现另一种用法。

        services.AddDbContext<ApplicationDbContext>(options =>
            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
    

    这将消除问题。

    【讨论】:

      猜你喜欢
      • 2011-10-02
      • 1970-01-01
      • 2021-10-23
      • 1970-01-01
      • 2021-06-16
      • 1970-01-01
      • 2021-11-09
      • 2018-07-10
      • 1970-01-01
      相关资源
      最近更新 更多