4

我刚刚更新了我的nuget包到EF 7.0.0-rc1-final从以前的EF 7版本它打破了我的SQL连接字符串代码。我已经安装EntityFramework.Core中的NuGet最新版本,但我似乎无法与“用”引用它更新到EF 7.0.0-rc1-final打破了SQL DbContextOptionsBuilder UseSqlServer

The Type 'DbContextOptionsBuilder' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework.Core, Version 7.0.0.0'

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

的错误。这只是在更新到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" 
    ] 
} 
+1

你应该张贴您的project.json文件作为你的问题的一部分 –

+1

你有没有更新的一切,有些东西你还是有beta8 –

+0

“Microsoft.Framework.Configuration。 Json“需要重命名为Microsoft.Extensions.Configuration.Json才能获得rc1-final –

回答

1

您需要更新一切RC1

"Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final", 
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", 
"EntityFramework.SqlServer": "7.0.0-rc1-final", 
"EntityFramework.SqlServer.Design": "7.0.0-rc1-final", 
"EntityFramework.Commands": "7.0.0-rc1-final", 
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", 
"Newtonsoft.Json": "8.0.1-beta2", 
"EntityFramework.Core": "7.0.0-rc1-final" 

我也怀疑,你必须下dnx451以及是否那些是合法的还是需要依赖

+0

也是你的网络命令需要更新为“网络”:“Microsoft.AspNet.Server.Kestrel” –

14

我相信这个名字也发生了变化:

'EntityF ramework.SqlServer ':“7.0.0-RC1决赛'

- 现在是:

'EntityFramework.MicrosoftSqlServer':“7.0.0-RC1决赛'

看帖子: Upgrading ASP.NET 5 Beta 8 to RC1

提示:从GitHub下载Asp.Net文档,看看他们(ASP.NET作者)是如何编码的引用和依赖......

+3

我有测试版和rc1,并删除,帮助 – matthewdaniel

+2

记得DLL地狱?准备好nuget ARMAGEDON .... – Sam

1

关键是要去除EntityFramework.SqlServer和替换它无线第EntityFramework.MicrosoftSqlServer

看到这个博客帖子大约Upgrading ASP.NET 5 Beta 8 to RC1

"dependencies": { 
    "EntityFramework.Commands": "7.0.0-rc1-final", 
    "EntityFramework.Core": "7.0.0-rc1-final", 
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", 
    "EntityFramework.Relational": "7.0.0-rc1-final" 
    },