我刚刚将nuget软件包从以前的EF 7版本更新为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");
}

错误:



我已经在NuGet中将EntityFramework.Core安装到最新版本,但似乎无法通过“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”
看到帖子:Upgrading ASP.NET 5 Beta 8 to RC1
提示:从GitHub下载Asp.Net文档,看看它们(ASP.NET作者)如何编码引用和依赖项...

10-07 22:21