Upgrading to EF 7.0.0-rc1-final broke SQL DbContextOptionsBuilder UseSqlServer

I just upgraded my nuget package to EF 7.0.0-rc1-final from a previous version of EF 7, it broke my sql connection string code.

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

Mistake:

The type "DbContextOptionsBuilder" is defined in an assembly that is not mentioned. You must add a reference to the assembly 'EntityFramework.Core, Version 7.0.0.0'

I installed EntityFramework.Core to the latest version on NuGet, but I cannot reference it using "using". This only happened when upgrading to rc1-final, and I cannot find any documents citing the change.

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"
  ]
}
+4
3

, :

'EntityFramework.SqlServer': "7.0.0-rc1-final '

- :

'EntityFramework.MicrosoftSqlServer': "7.0.0-rc1-final '

: ASP.NET 5 Beta 8 RC1

. Asp.Net GitHub , ( ASP.NET) ...

+14

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,

+1

, EntityFramework.SqlServer EntityFramework.MicrosoftSqlServer.

ASP.NET 5 Beta 8 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"
  },
+1

Source: https://habr.com/ru/post/1616622/


All Articles