App.config entries to enable SQL Server Compact 3.5 SP2 private deployment on target system AND development system under VS 2010

Beantwortet App.config entries to enable SQL Server Compact 3.5 SP2 private deployment on target system AND development system under VS 2010

  • Thursday, June 14, 2012 3:54 PM
     
     

    Erik, your blog post on private deployment of SQL Server Compact 3.5 SP2 (http://erikej.blogspot.com/2012/05/private-deployment-of-sql-server.html) was very helpful in deploying SQL CE to target systems and runtime operation under my deployed application, but when I execute my application in the Visual Studio IDE on my development PC I still get the following error:

    • Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8080. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.

    In http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/31d12a9c-0df5-4d4e-971a-4f1d8a0ac176 you advised me

    • "... do not use providerName="Microsoft.SqlServerCe.Client.3.5" /> (it is for Visual Studio only, and not redistributable) but use providerName="System.Data.SqlServerCe.3.5" /> in your connection strings..."

    My current App.config is setup in accordance with your suggestions for private deployment, but I wonder if there is some incompatibility you can see with the Visual Studio runtime that might be causing the exception noted above on my development PC. My App.config listing is as follows:

    <?xml version="1.0"?>
    <configuration>
      <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.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91"       />
        </DbProviderFactories>
      </system.data>
      <connectionStrings>
      <add name="cds.My.MySettings.REdataConnectionStringSDF" connectionString="Data Source=E:\cdsProject\SchemaMaster\REdata.sdf"
       providerName="Microsoft.SqlServerCe.Client.3.5" />
      <add name="cds.My.MySettings.REdataConnectionStringSDFschema"
       connectionString="Data Source=E:\cdsProject\SchemaMaster\REdata.sdf"
       providerName="Microsoft.SqlServerCe.Client.3.5" />
     </connectionStrings>
     <system.diagnostics>
      <sources>
       <!-- This section defines the logging configuration for My.Application.Log -->
       <source name="DefaultSource" switchName="DefaultSwitch">
        <listeners>
         <add name="FileLog"/>
         <!-- Uncomment the below section to write to the Application Event Log -->
         <!--<add name="EventLog"/>-->
        </listeners>
       </source>
      </sources>
      <switches>
       <add name="DefaultSwitch" value="Information"/>
      </switches>
      <sharedListeners>
       <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
       <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
       <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
      </sharedListeners>
     </system.diagnostics>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="dll_lib"/>
        </assemblyBinding>
      </runtime>
      </configuration>


    • Edited by BGood Thursday, June 14, 2012 4:02 PM xml formatting
    • Edited by BGood Thursday, June 14, 2012 4:04 PM
    •  

All Replies

  • Thursday, June 14, 2012 5:51 PM
     
     Answered
    I figured it out.  I had reconfigured to a multi-project solution and had not copied the x86 and AMD64 folders to the startup project.

    -BGood