Home

LINQPad with SQL CE 3.5SP2 Private Deployment Possible?

I have a system that does not have a central installation of SQL CE 3.5 SP2 and I need to query the SQL CE database on this system and I would like to use LINQPad and not have to install SQL CE centrally on this system. I have placed the SQL CE dlls into the folder with LINQPad and adding the private redirect into the LINQPad.exe.config and I can connect to the database and test and it tests OK but then I click OK and the connection panel shows "Unable to find the requested .Net Framework Data Provider. It may not be installed." The files I put into the folder with LINQPad.exe are

System.Data.SqlServerCe.Entity.dll
sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
System.Data.SqlServerCe.dll

In the config I added






So I think I have done everything that should allow it to use a private deployment of SQL CE and it sort of seems like it is partially working because I can connect and test.

Any suggestions, thoughts or ideas?

Thank you in advance

Comments

  • edited December 2018
    You need to configure the SQL CE provider so that it shows when you run the following query:
    System.Data.Common.DbProviderFactories.GetFactoryClasses()
    
    Normally this is done in the machine.config file (when CE is installed), but I imagine you could take the relevant content from the machine.config and put inside the LINQPad.config and LINQPad.exe.config files (you may need to patch both), and it should work.
  • edited December 2018
    These entries in the LINQPad.config did the trick for me as long as I left the SQL CE Private Assemblies listed above in the same folder with the LINQPad.exe. Be sure to match the bitness (32 or 64) of the SQL CE components with that of LINQPad.exe.

    <configuration> <runtime> <assemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-3.5.1.50" newVersion="3.5.1.50"/> </dependentAssembly> </assemblyBinding> </runtime> <system.data> <DbProviderFactories> <remove invariant="System.Data.SqlServerCe.3.5" /> <add name="Microsoft SQL Server Compact Data Provider 3.5" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> </DbProviderFactories> </system.data> </configuration>
Sign In or Register to comment.