Note that there are some explanatory texts on larger screens.

plurals
  1. POSQL Server Compact 4.0 private deployment with Entity Framework 6.0 and NuGet
    primarykey
    data
    text
    <p>I have standardly setup WPF project with Entity Framework 6 and SQL Server Compact 4.0 installed. When I build my project all the necessary files for SQL Server CE deployment are correctly copied to the <code>Release</code> folder, including <code>System.Data.SqlServerCe.dll</code>.</p> <p>But running project on a machine without SQL Server Compact installed throws <code>System.IO.FileLoadException</code>.</p> <p>In my development environment is the <code>System.Data.SqlServerCe.dll</code> loaded from GAC. I have found this reference, where the version numbers of dlls are explained: <a href="http://technet.microsoft.com/en-us/library/gg213826.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/gg213826.aspx</a></p> <p>I supposed that the version of <code>System.Data.SqlServerCe.dll</code> assembly form NuGet is 4.0.0.0. </p> <p>So I have manually changed <code>System.Data.SqlServerCe.dll</code> reference in my project to 4.0.0.1 file form the Private folder and copied <code>System.Data.SqlServerCe.dll</code> 4.0.0.1 to the production machine. </p> <p>I have changed <code>app.config</code> like that:</p> <pre><code> &lt;system.data&gt; &lt;DbProviderFactories&gt; &lt;remove invariant="System.Data.SqlServerCe.4.0" /&gt; &lt;add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/&gt; &lt;/DbProviderFactories&gt; &lt;/system.data&gt; </code></pre> <p>Now I get this exception on development machine:</p> <blockquote> <p>The connection given is not of type 'SqlCeConnection'.</p> </blockquote> <p>On production machine I get <code>System.Data.Entity.Core.EntityException</code>.</p> <p>Is there any chance to get private deployment working with NuGet and EF 6? Or is it necessary to copy manually all the files in x86, amd64 folders? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload