Entity framework problem : EntityFramework.SqlServer’ registered in the application config file for the ADO.NET provider with invariant name ‘System.Data.SqlClient’ could not be loaded

EntityFramework.SqlServer’ registered in the application config file for the ADO.NET provider with invariant name ‘System.Data.SqlClient’ could not be loaded
See: http://stackoverflow.com/questions/21175713/no-entity-framework-provider-found-for-the-ado-net-provider-with-invariant-name
I followed their advice in my dbContext class
///

/// A partial class extention to the auto generated code created by Entity Framework.
/// this allows us to create a normal connection string, then create an entity connection string, and pass it into the
/// entity data model.
/// So we can use DEV, QA, and PROD versions of our database based on switches in our config file.
///

public partial class SoftwareCatalogEntities : DbContext
{
private volatile System.Type _dependency;
// http://stackoverflow.com/questions/21175713/no-entity-framework-provider-found-for-the-ado-net-provider-with-invariant-name

///

/// An additional Constructor for the Entity Framework Model
/// that allows us to customize the connection String before a
/// context is created and returned.
///

/// Modified connection string instead of default connection string used by default constructor that takes no parameters.
public SoftwareCatalogEntities(string EntityConnectionString) : base(EntityConnectionString)
{
_dependency = typeof(System.Data.Entity.SqlServer.SqlProviderServices); // will cause the sql server dll to be copied
}

Advertisements

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: