Quantcast
Channel: SQL Server Compact Forum
Viewing all articles
Browse latest Browse all 193

SQL Server Compact 3.5 SP2 Private Deployment in separate folder in project tree fails

$
0
0

I have a desktop .NET 4.0 C#  application and I'm trying to do a private deployement of SQL Server Compact 3.5 SP2. I have followed the steps described in here, here and here and it worked fine. In an attempt to improve the configuration, I followed the instructions described in this post to isolate the SQL CE files in a separated folder. However, after doing that, the application no longer works. When I try to run it, I get the following error message:

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.

StackTrace:    at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

   at System.Data.SqlServerCe.SqlCeConnection..ctor()

   at System.Data.SqlServerCe.SqlCeProviderFactory.CreateConnection()

   at System.Data.EntityClient.EntityConnection.GetStoreConnection(DbProviderFactory factory)

   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)

   at System.Data.EntityClient.EntityConnection..ctor(String connectionString)

   at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)

   at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)

 ...

InnerException:

System.DllNotFoundException: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

   at System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

StackTrace:    at System.Data.SqlServerCe.NativeMethods.GetSqlCeVersionInfo(IntPtr& pwszVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath, Int32 moduleVersion)

   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()

InnerException: null

Here is how the files are structured in the project:

The relevant entries in the "App.config" file:

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><probing privatePath="SqlCe35SP2"/><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><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>

I have checked the bin output and the files are corrected copied to it, mirroring the project tree.

Has any one got a clue on what is the problem here?


Viewing all articles
Browse latest Browse all 193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>