1

I'm trying to deploy a desktop application (wpf) that uses an external .dll that defines the logical model. In this external library the model is defined using EntityFramework. In the wpf application I use SQL Server CE as database using this app.config info:

<connectionStrings>
   <add name="SomeManager" 
        connectionString="Data Source=Database/SomeDatabase-20130220200325.sdf" 
        providerName="System.Data.SqlServerCE.4.0"/>
</connectionStrings>

I want that the final client doesn't need to install SQL Server CE in his machine, so I want include the libraries CE libraries into my finall folder. I know it is possible due in the MSDN they give a solution for it. Copying the seven files of SQL Server CE 4 on the finall folder, and also the System.Data.SqlServerCE.dll file. I do this, but for some reason the application still is trying to get the libraries from the system, and not from the local application folder, so when I run the app in a machine without the SQL Server CE 4 installed, it doesn't runs.

What could fix this problem, I will appreciate any ideas. Thanks...

2
  • See my blog post here: erikej.blogspot.dk/2011/02/… - also, check the providername spelling/casing Commented Sep 24, 2013 at 16:14
  • Seams to be exactly the solution I'm looking for. Please make me an answer I will be glad to accept it. Commented Sep 24, 2013 at 16:21

1 Answer 1

3

You can include the SQL Server Compact binaries with your application, and simply xcopy deploy them, for detailed inctructions see my blogpost here: http://erikej.blogspot.dk/2011/02/using-sql-server-compact-40-with.html

Sign up to request clarification or add additional context in comments.

4 Comments

I have a problem with this solution, maybe you can help me. This works when I run the code in some machines, and in others it doesn't. I uninstall the sqlserverce from the develop machine, and I when I run debuggin, in the console I can see it load the library from the running folder. But when I run the app in other machines (windows xp 32 bits, and windows 7 32 bits) it doesn't works. Also it works on a Virtual Machine wirth windows 7 that I created. What could it be? I will appreciate the helps. Thanks
Are all the required files copied as Content? Do you have the correct files in the x86 and AMD64 folders. Does your project target AnyCPU? If yes, feel free to email me a repro project
I have the target to x86. Could be this the problem?
Yes, that works perfectly!! I found the problem. It was that the proyect originaly was for framework 4.5, and I converted it to 4.0. But seams still need some libraries from the framework 4.5, and don't load the data. But the local SSCE works fine on the framework 4.5. Thanks...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.