Error Testing Cutom EF Core Connection

Options

Hi Everyone.
I m trying to connect through my context dll on EF Core 3.1 .
My constructor is
public TriangleConnectContext(DbContextOptions options)
: base(options)
{

    }

Set Path to custom assembly to my bin dll generated.
Set full type Name dbContext to TriangleWS.Data.TriangleConnectContext

Set My provider to 'Microsoft.EntityFrameworkCore.SqlServer'

My connection string : Server=(local);database=TriangleConnect;Integrated Security=True;Persist Security Info=True;MultipleActiveResultSets=true;Application Name=TriangleWS.Connect

And when i test :
"Error Testing Custom EF Core Connection : Cannot resolve 'Microsoft.EnityFrameworkCore.SqlServer.Dll'

Any Idea ???

Comments

  • Can you please post the .deps.json file that's in the same folder as your custom assembly DLL?

    Also, right-click the connection and click 'Show assembly resolution log' and post that, too.

  • I had the same issue and the problem is that we need to explicitly add a package reference to Microsoft.EntityFrameworkCore.SqlServer

    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.7" />

    If you have the context in one assembly and for example, the migrations in a different assembly as these relate to a specific database type like SQL Server, then this could be a situation when you don't directly reference this package in the assembly that produces the context. Not sure if this is something that LINQ Pad could fix