chris
chris

Reputation: 1216

ASP NET CORE Could not load System.Data.SqlClient

I have an aspnetcore solution that I split into three projects:

Using the dotnet cli tooling (dotnet-ef) I was able to add migrations to the project successfully. However when I execute update database to apply the migrations, I get an exception that I cant seem to resolve.

C:\Users\chris\Documents\project\core\src\Project.EF
dotnet ef database update -s ..\Project.Core

Could not load file or assembly 'System.Data.SqlClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

If anyone has some direction on how I can get this final piece working, it would be greatly appreciated. Below is copy of my Project.EF project.json

{
  "dependencies": {
    "Microsoft.EntityFrameworkCore": "1.0.0-*",
    "Microsoft.EntityFrameworkCore.Commands": "1.0.0-*",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
    "Microsoft.AspNetCore.Hosting": "1.0.0-*",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
    "OpenIddict.EF": "1.0.0-*",
    "Project.Models": "1.0.0-*"
  },

  "frameworks": {
    "dotnet5.4": {
      "imports": "portable-net451+win8",
      "dependencies": {
        "System.Data.SqlClient": "4.0.0-*"
      }
    }
  },

  "tools": {
    "dotnet-ef": "1.0.0-*"
  }
}

Upvotes: 0

Views: 2596

Answers (1)

Sangram More
Sangram More

Reputation: 247

The purpose of this design document is to define what Entity Framework requires from a SqlClient implementation to be used in EF7 with support for ASP.NET vNext on CoreCLR.

There are two separate components required to make this happen, System.Data.Common and a SqlClient implementation of System.Data.Common. This document covers the requirements for both of these components.

https://github.com/aspnet/EntityFramework/wiki/Design-SqlClient-for-EF7

Upvotes: -2

Related Questions