Deploying SQL Server CE 4.0 privately
Thanks to Agile Tech
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>
About this entry
You’re currently reading “ Deploying SQL Server CE 4.0 privately ,” an entry on Chui's Counterpoint
- Published:
- 5.20.12 / 10am
- Category:
- Uncategorized
Comments are closed
Comments are currently closed on this entry.