Skip to content

Running the standalone edition really standalone

Erik Ejlskov Jensen edited this page Jan 4, 2017 · 7 revisions

Why

In some situations, it could be nice to be able to run the standalone edition on an user machine with only .NET 4.5 installed. (Normally, the standalone edition requires the SQL Server Compact runtime MSI to be installed and present in the .NET GAC (Global Assembly Cache)

How

  1. Download the latest daily standalone build (see https://github.com/ErikEJ/SqlCeToolbox/releases)

  2. Place the downloaded .exe in it's own folder.

  3. Add an app.config file named SqlCe40Toolbox.exe.config, with the following contents:

      <configuration>
      <runtime>
         <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
           <dependentAssembly>
             <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
             <bindingRedirect oldVersion="4.0.0.0-4.0.0.1" newVersion="4.0.0.1"/>
           </dependentAssembly>
         </assemblyBinding>
        </runtime>
        <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.SqlServerCe.3.5" />
          <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.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </DbProviderFactories>
       </system.data>
     </configuration>

4: Copy System.Data.SqlServerCe.dll and the x86 folder from

C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private

Zip up all these files, and share the zip file!

A sample .zip file is available here