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 http://go.microsoft.com/fwlink/?LinkId=260882 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.
[TestClass]
public class MyTest
{
public System.Data.Entity.SqlServer.SqlProviderServices SqlServerInstance { get { return System.Data.Entity.SqlServer.SqlProviderServices.Instance; } }
}
More information can be found at:
http://robsneuron.blogspot.com/2013/11/entity-framework-upgrade-to-6.html