No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’

When one of the projects in your solution is referencing the Entity Framework to access a database the Entity Framework NuGet package is added to that project. In the Visual Studio IDE your application may work fine, but when you deploy it to the test or production server the following error message may appear:

Exception Type: System.Data.Entity.Core.MetadataException
Exception: Schema specified is not valid.
Errors: [YOUR_DATABASE].ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’. Make sure the provider is registered in the ‘entityFramework’ section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

To resolve the problem add the Entity Framework NuGet package to the main project of your application:

  • In the Solution Explorer right click the main project,
  • Select Manage NuGet Packages… in the context menu,
  • On the left side of the NuGet manager select Online, Microsoft and .NET,
  • On the right side enter EntityFramework into the search field and hit Enter,
  • In the middle click Install in the EntityFramework box.

Join the Conversation

2 Comments

Leave a comment

Your email address will not be published. Required fields are marked *