title: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'.
body: <p>We are using EntityFramework 6 with Code First.  We have a console app that has no reference to EntityFramework but reads the connection string from its App.config.  It calls the DatabaseInitializationUtilities assembly passing the connection string as a parameter. </p>
  
  <p>DatabaseInitializationUtilities has the reference to EF6 (EntityFramework and EntityFramework.SqlServer). Its App.config is this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;configuration&gt;
       &lt;configSections&gt;
          &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
        &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
       &lt;/configSections&gt;
       &lt;system.serviceModel&gt;
           &lt;bindings&gt;
              &lt;basicHttpBinding&gt;
                  &lt;binding name="BasicHttpBinding_IAuthentication" /&gt;
              &lt;/basicHttpBinding&gt;
           &lt;/bindings&gt;
           &lt;client&gt;
              &lt;endpoint address="http://localhost/SecurityServices/Authentication.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthentication" contract="SecurityService.IAuthentication" name="BasicHttpBinding_IAuthentication" /&gt;
           &lt;/client&gt;
        &lt;/system.serviceModel&gt;
        &lt;entityFramework&gt;
           &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
              &lt;parameters&gt;
                 &lt;parameter value="v11.0" /&gt;
              &lt;/parameters&gt;
           &lt;/defaultConnectionFactory&gt;
           &lt;providers&gt;
              &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
           &lt;/providers&gt;
        &lt;/entityFramework&gt;
     &lt;/configuration&gt;
  </code></pre>
  
  <p>When execution reaches a line where DatabaseInitializationUtilities attempts to run a script</p>
  
  <pre><code>context.Database.ExecuteSqlCommand(script.ScriptText)
  </code></pre>
  
  <p>the error is thrown:</p>
  
  <blockquote>
    <p>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 <a href="http://go.microsoft.com/fwlink/?LinkId=260882" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkId=260882</a> for more information.</p>
  </blockquote>
  
  <p>I believe the remedy is exactly what I have in my config file, so I don't understand the problem.</p>
  
  <p>NOTE: Resharper is bluelining the  node and reporting
  "The element 'EntityFramework' has an invalid child element 'providers'.  However, the section was injected by NuGet when I installed EF6.</p>
  
  <p>Any ideas?</p>