Deploying application using SQL CE 4.0 to work bot

2019-09-17 20:06发布

问题:

I am planning to create an application which uses SQL CE 4.0. I saw like there are two types of deployment central and private. So now i am planning to use private deployment. So all the dll must be included in the project as explained here.

But I tried just adding all dll from my XP PC(32 bit) and not added any 64 bit dlls(but it was mentioned to add 64 bit dlls). Then i set platform to x86. After building application i tried running my application in a 64 bit PC and it worked properly. I was expecting it would give error as i have not included 64 bit dlls.

So the reason for proper working in 64 bit pc is due to x86 platform which I have set? Also can I use same method to deploy application and give it to my customers(instead of using 32 bit and 64 bit dll separately)?

EDIT:

In a windows XP PC i installed only .net 2.0 and then run my application which has sql ce 4.0 SP1 private deployment and it worked fine.

Then i tested central deployment(no dlls in application path) in same pc after installing sql ce 4.0 sp1 , while running application I got 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.

Then i uninstalled sql ce 4.0 sp1 and then installed sql ce 4.0 (without sp1) and now central deployment application worked!! So what is the problem actually?

In SQL CE 4.0 download page it's mentioned like .net 3.5 SP1 is the minimum requirement. So does private deployment works only with .net 2.0?Also why i got error for central deployment with sql ce 4.0 sp1?

回答1:

Yes, forcing x86 is a good and simple approach, and will eork well on both desktop platforms