App.config for WinForm.NET 4 for Private Deployment of SQL Server CE SP2

My Visual Studio 2010 (C #) application is working, and I am trying to deploy it using the installation project this week without any success.

I started with the Steve Lasker weblog on Private SQL Server Compact Deployment with the Entity Provider ADO.NET Provider . I had to modify the app.config project app.config to include the following:

  <system.data> <DbProviderFactories> <remove invariant="System.Data.SqlServerCe.3.5"></remove> <add name="Microsoft SQL Server Compact Data Provider" 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.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/> </DbProviderFactories> </system.data> 

This installation only worked successfully on a PC where SQL Server CE has already been installed (for example, only MY ).

I had to take a closer look at the article and noticed that it was written in 2008, but David V left a comment related to SQL CE Team article Troubleshooting: Private Deployment of the Entity Framework SQL Server Compact 3.5 SP2 ADO.NET Platform Provider (System.Data. SqlServerCe.Entity.dll) in the application folder does not work . In their article, they said that I need to add “assembly binding redirection” (bad link) and add the app.config file with the following information:

  <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/> <bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50"/> </dependentAssembly> </assemblyBinding> </runtime> 

So here I am with an installer that does not install.

  <?xml version="1.0"?> <configuration> <appSettings> <add key="LastRun" value=""/> <add key="UserName" value=""/> </appSettings> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/> </startup> <system.data> <DbProviderFactories> <remove invariant="System.Data.SqlServerCe.3.5"></remove> <add name="Microsoft SQL Server Compact Data Provider" 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.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/> </DbProviderFactories> </system.data> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" culture="neutral"/> <bindingRedirect oldVersion="3.5.1.0-3.5.1.50" newVersion="3.5.1.50"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> 

Is the app.config file corrupt?

My application still works fine, but the installer cannot install anything. The installer error is always 2727 for a temporary file name that changes:

DEBUG: error 2727: directory entry '_1083472CD2EB47548297E3336FCD9A58' does not exist in the Directory table

What should I do with this?

Has anyone successfully deployed Microsoft SQL Server Server SP2 for a private instance?

0
source share
1 answer

I found a solution in Code Project called Creating a Private Installation for SQL Compact , which fixed my problems.

In principle, it seems that it all boiled down to the fact that the VS installer did not create folders or copy files needed by SSCE. The link above details how to do this.

I hope this helps others.

+2
source

All Articles