更新到EF 7.0.0-rc1-final打破了SQL DbContextOptionsBuilder UseSqlServer

asp.net-core c# entity-framework entity-framework-core sql-server

我剛剛從之前的EF 7版本更新了我的nuget包到EF 7.0.0-rc1-final,它破壞了我的sql連接字符串代碼。

using System.Collections.Generic;
using ComicEndpoints.Models;
using System.Threading.Tasks;
using Microsoft.Data.Entity;
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
    options.UseSqlServer(@"ConnectionString");
}

錯誤:

Type'DbContextOptionsBuilder'在未引用的程序集中定義。您必須添加對程序集'EntityFramework.Core,Version 7.0.0.0'的引用

我已經將EntityFramework.Core安裝到NuGet中的最新版本,但我似乎無法用'using'來引用它。這只是在更新到rc1-final時發生的,我找不到任何引用該更改的文檔。

project.JSON

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final",
    "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
    "EntityFramework.SqlServer": "7.0.0-beta8",
    "EntityFramework.SqlServer.Design": "7.0.0-beta8",
    "EntityFramework.Commands": "7.0.0-rc1-final",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta8",
    "Newtonsoft.Json": "8.0.1-beta2",
    "EntityFramework.Core": "7.0.0-rc1-final"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini",
    "ef": "EntityFramework.Commands"
  },

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "Microsoft.AspNet.WebApi.Cors": "5.2.3",
        "Microsoft.Owin.Cors": "3.0.1"
      }
    },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ]
}

熱門答案

我相信這個名字也改變了:

'EntityFramework.SqlServer':“7.0.0-rc1-final”

- 就是現在:

'EntityFramework.MicrosoftSqlServer':“7.0.0-rc1-final”

請參閱post: 將ASP.NET 5 Beta 8升級到RC1

提示:從GitHub下載Asp.Net文檔,看看它們(ASP.NET作者)如何編寫引用和依賴項...



許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow
這個KB合法嗎? 是的,了解原因
許可下: CC-BY-SA with attribution
不隸屬於 Stack Overflow
這個KB合法嗎? 是的,了解原因