Warning: Creating default object from empty value in /home/agilemed/aendeavors.com/wp-includes/ms-load.php on line 138

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/agilemed/aendeavors.com/wp-includes/ms-load.php:138) in /home/agilemed/aendeavors.com/wp-content/plugins/amazon-product-in-a-post-plugin/amazon-product-in-a-post.php on line 102

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/agilemed/aendeavors.com/wp-includes/ms-load.php:138) in /home/agilemed/aendeavors.com/wp-content/plugins/amazon-product-in-a-post-plugin/amazon-product-in-a-post.php on line 102
Bin Deploy SqlCE 4.0 and EF 4.1 » Agile Tech

«

Jun
09

Bin Deploy SqlCE 4.0 and EF 4.1

When attempting to do a private deployment using SQL Compact Edition and Entity Framework, several errors continued to pop up on client installations:

  • Unable to find the requested .Net Framework Data Provider
  • Could not load file or assembly System.Data.SqlServerCe.Entity or one of its dependencies

The System.Data.SqlServerCe and other binaries were already included and copied locally, but SqlServerCe.Entity wasn't present. To get this deployment to work, the following needed to be done:

  • Make sure System.Data.SqlServerCe is referenced and set to "Copy local" in properties
  • Include the 7 needed SqlCe assembiles from Program Files\Microsoft SQL Server Compact Edition\v4.0, make sure to set as "Content" and "Copy if newer" in properties:
    • sqlceca40.dll
    • sqlcecompact40.dll
    • sqlceer40EN.dll
    • sqlceme40.dll
    • sqlceoledb40.dll
    • sqlceqp40.dll
    • sqlcese40.dll
  • Install the following library package references using NuGet (right click References->Add Library Package Reference)
    • EntityFramework
    • EntityFramework.SqlServerCompact
    • This will create packages that will contain lib directories for System.Data.SqlServerCe.Entity, reference and "Copy local" for this library
  • Add the following to app.config:

 

<system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SqlServerCe.4.0" />
      <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.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    </DbProviderFactories>
</system.data>

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>