title: SQL Server CE provider with invariant name 'System.Data.SqlServerCe.4.0' could not be loaded
body: <p>Good evening everyone. I try to use SQL Server Compact Edition and Entity Framework in simplest console application. But I get the following exception.</p>
  
  <blockquote>
    <p>The Entity Framework provider type
    'System.Data.Entity.SqlServerCompact.SqlCeProviderServices,
    EntityFramework.SqlServerCompact' registered in the application config
    file for the ADO.NET provider with invariant name
    'System.Data.SqlServerCe.4.0' could not be loaded. Make sure that the
    assembly-qualified name is used and that the assembly is available to
    the running application. See
    <a href="http://go.microsoft.com/fwlink/?LinkId=260882" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=260882</a> for more information.</p>
  </blockquote>
  
  <p>So I started find the answer in the internet. After googling I found the following answers in StackOverflow:</p>
  
  <p><a href="https://stackoverflow.com/questions/19821284/no-entity-framework-provider-found-for-the-ado-net-provider-with-invariant-name">No Entity Framework provider found for the ADO.NET provider with invariant name &#39;System.Data.SqlServerCe.4.0&#39;</a></p>
  
  <p>I did the following configuration file.</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;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="SQLCE.DAL.BreakAwayContex" providerName="System.Data.SqlServerCe.4.0" connectionString="Data Source=D:\TestDatabase.sdf" /&gt;
    &lt;/connectionStrings&gt;
    &lt;entityFramework&gt;
      &lt;providers&gt;
       &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
       &lt;provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" /&gt;
      &lt;/providers&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="System.Data.SqlServerCe.4.0" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>But I still have this exception. So how can I fix it? Thank you very much for answer or your device.</p>
  
  <p>Have a nice evening.</p>