title: Using Entity Framework with an SQL Compact Private Installation
body: <p>I am using Entity Framework 4 in a desktop application with SQL Compact. I want to use a <em>private installation</em> of SQL Compact with my application, so that my installer can install SQL Compact without giving the user a second installation to do. It also avoids versioning hassles down the road.</p>
  
  <p>My development machine has SQL Compact 3.5 SP1 installed as a public installation, so my app runs fine there, as one would expect. But it's not running on my test machine, which does not have SQL Compact installed. I get this error:</p>
  
  <pre><code>The specified store provider cannot be found in the configuration, or is not valid.
  </code></pre>
  
  <p>I know some people have had difficulty with SQL Compact private installations, but <a href="http://www.codeproject.com/KB/database/SQLCEPrivateInstallation.aspx" rel="noreferrer">I have used them for a while</a>, and I really like them. Unfortunately, my regular private installation approach isn't working. I have checked the version numbers on my SQL CE files, and they are all 3.8.8078.0, which is the SP2 RC version.</p>
  
  <p>Here are the files I have included in my private installation:</p>
  
  <ul>
  <li>sqlcecompact35.dll</li>
  <li>sqlceer35EN.dll</li>
  <li>sqlceme35.dll</li>
  <li>sqlceqp35.dll</li>
  <li>sqlcese35.dll</li>
  <li>System.Data.SqlServerCe.dll</li>
  <li>System.Data.SqlServerCe.Entity.dll</li>
  </ul>
  
  <p>I have added a reference to System.Data.SqlServerCe to my project, and I have verified that all of the files listed above are being copied to the application folder on the installation machine.</p>
  
  <p>Here is the code I use to configure an EntityConnectionStringBuilder when I open a SQL Compact file:</p>
  
  <pre><code>var sqlCompactConnectionString = string.Format("Data Source={0}", filePath);
  
  // Set Builder properties
  builder.Metadata = string.Format("res://*/{0}.csdl|res://*/{0}.ssdl|res://*/{0}.msl", edmName);
  builder.Provider = "System.Data.SqlServerCe.3.5";
  builder.ProviderConnectionString = sqlCompactConnectionString;
  var edmConnectionString = builder.ToString();
  </code></pre>
  
  <p>Am I missing a file? Am I missing a configuration stepp needed to tell Entity Framework where to find my SQL Compact DLLs? Any other suggestions why EF isn't finding my SQL Compact DLLs on the installation machine? Thanks for your help.</p>