After installing the NugetPackage EntityFramework in a .NET 4.5.2 Visual Studio Test project, using an EntityFramework DbContext would throw an exception during test run:


The Entity Framework provider type ‘System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer’ registered in the application config file for the ADO.NET provider with invariant name ‘System.Data.SqlClient’ could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See for more information.


This can be fixed, by touching the System.Data.Entity.SqlServer.SqlProviderServices.Instance in your test project, e.g. by adding a property that returns the System.Data.Entity.SqlServer.SqlProviderServices.Instance to the Test class.



public class MyTest



public System.Data.Entity.SqlServer.SqlProviderServices SqlServerInstance { get { return System.Data.Entity.SqlServer.SqlProviderServices.Instance; } }




More information can be found at:



Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.