gstewart
gstewart

Reputation: 53

SqlClientFactory error with EF 6 - Unable to determine the provider name for provider factory

I'm getting this error when I attempt access a collection within the context: Unable to determine the provider name for provider factory of type 'Microsoft.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

My config has the standard connection string:

<add name="someDb" connectionString="Data Source=****;Initial Catalog=****;Integrated Security=SSPI;MultipleActiveResultSets=True;" providerName="Micorsoft.Data.SqlClient" />

This has been working fine for years (the providerName was System.Data.SqlClient), now trying to upgrade to Standard2.0 with EF 6.2.

Hoping there's a fix I can make to the connection string or in the DbContext, but I'm stumped.

Upvotes: 1

Views: 1373

Answers (1)

Krishna Bankar
Krishna Bankar

Reputation: 124

Do you have NuGet installed if not goto NuGet package manager and install then Simply add a NuGet dependency on Microsoft.Data.SqlClient and update

this may help you.

Upvotes: 1

Related Questions