Unable to find the requested .Net Framework Data Provider. It may not be installed

ef-code-first ef-migrations entity-framework entity-framework-6


When attempting to add a customized migration step to our EF Code-first migrations this morning, I unexpectedly received the following exception:

The ADO.NET provider with invariant name '.NET Framework Data Provider for SQL Server' is either not registered in the machine or application config file, or could not be loaded.

I can successfully run an update-database command on our SQL Server, but the add-migration command does not work.

With regard to SQL Server 2012, we are utilizing.Net 4.5.1 and EF Code First 6.0.1.

Our data project's configuration file looks like this:

<?xml version="1.0" encoding="utf-8"?>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
        <parameter value="System.Data.SqlClient" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    <add name="Data.StorageContext" connectionString="server=.\MSSQL01;Database=OutageTracking; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />

Take note of the complaint from Visual Studio 2012 regarding the -element in the -section.

Any suggestions?



3/17/2014 1:25:05 PM

Accepted Answer

Since ".NET Framework Data Provider for SQL Server" is not an invariant name, there must be a corrupt.config file someplace.

12/9/2013 3:55:16 PM

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow