0
votes

I have created application which uses SQL Server CE 4.0 SP1. I tried using central deployment. So I added reference to System.Data.SqlServerCe.dll (of SQL Server CE 4.0 SP1 )using add reference in visual studio.

Then I tried running application in

  1. On a windows XP PC having only .net 2.0 and SQL Server CE 4.0 SP1. But it didn't work and gave error like

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

  2. Then I tried on a PC with only .net 2.0 and SQL Server CE 4.0. It worked properly.

So how it does not work for SQL Server CE 4.0 SP1 even if I added System.Data.SqlServerCe.dll of SQL Server CE 4.0 SP1? What I am missing? Should i need to change anything in my code (.config) to target 4.0 SP1?

1
Bitness difference? Operating System x64 vs x32? - Steve
Set Copy local = true in referencing assembly properties - opewix
The installtion of SQL CE on the first PC is broken. Reinstall/repair. Make sure to reference assembly version 4.0.0.0 everywhere (and not 4.0.0.1). There is not api differnce between 4.0 and 4.0 SP1 - ErikEJ
@Steve operating system are same(32 bit) - IT researcher
@JesseJames if i set copy local=true to only System.Data.SqlServerCe.dll den i wil get error like "Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8854. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details." If I include all dll from SQL ce install folder(native components) then it works . but it will be private deployment.I have asked the same in question here stackoverflow.com/questions/27548397/… and it worked. - IT researcher

1 Answers

0
votes

SQL Server Compact 4.0 requires .NET 3.5 SP1 or later. It will not run a machine with just .NET 2.0. See https://www.microsoft.com/en-us/download/details.aspx?id=17876