gpt4 book ai didi

c# - 更新到 EF 7.0.0-rc1-final 破坏了 SQL DbContextOptionsBuilder UseSqlServer

转载 作者:太空狗 更新时间:2023-10-29 22:10:30 26 4
gpt4 key购买 nike

我刚刚将我的 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");
}

错误:

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'

我已将 EntityFramework.Core 安装到 NuGet 的最新版本,但我似乎无法使用“使用”来引用它。这只是在更新到 rc1-final 时发生的,我找不到任何引用该更改的文档。

项目.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 作者)如何编写引用和依赖项...

关于c# - 更新到 EF 7.0.0-rc1-final 破坏了 SQL DbContextOptionsBuilder UseSqlServer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33813648/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com