errors while deploying sql server compact 3.5 sp2 privately
So Ive spent quite some time today with sql lite and saw the .开发者_开发问答net4 providers were very un stable. So I figured I'll use SqlCE. Its supposed to have a zero config/install instead its the most confusing way to deploy the thing.
I check numerous SO questions and these articles: Link
Link
A More updated short guide:
http://robindotnet.wordpress.com/2010/02/28/how-to-deploy-the-sqlserver-compact-edition-software-locally/So here is my problem, without the <runtime>
tag bit, it WORKS on my DEV machine but NOT on XPSp3 without the SqlCE runtimes. It gives me a FileIOLoadException
WITH the <runtime
> tag it works on XpSp3 but on my dev box it says :
Could not load file or assembly 'System.Data.SqlServerCe, Version=3.5.1.50, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I checked this answer but Im VERY confused. Also, apparently the msdn blog articles are off, you need to include 7 dlls all together. And the System.Data.SqlServerCe.dll
and System.Data.SqlServerCe.Entity.dll
both come from folder named "Private" where the runtimes are installed.
<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.0, 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>
How in the world is this zero configuration!? I have no idea what really is going wrong nor what I did to make it right? Isn't there documentation on this anywhere Other than some old blogs?
Just simply put, once I need to deploy, I just want to be able to xcopy exe and other files and it should work.So where is the reference/msdn/documentation/step-by-step on how to deploy?
Also sqlce will work on a box with ONLY .net4 installed right?
I had a very similar problem posted on S.O. in 6851346, and I just solved it.
I don't know if you are still struggling with this, but I found a solution on Code Project called Creating a Private Installation for SQL Compact that fixed my problems right up.
I hope this helps others, too.
Do you use Entity Framework? If not, the runtime tag is not required.
You must change this: Version=3.5.1.0 (in the add tag) to 3.5.1.50, and make sure you use the System.data.SqlServerCe.dll from the Private folder (it has this special assembly version)
精彩评论