开发者

How should I use SQL Server Compact Edition in a SharpDevelop project on multiple computers using Git?

I have a project where I want to use SQL Server Compact Edition and SharpDevelop. I also want to use Git for version control.

To use SQL Server CE, I download and install it on C:\Program Files\Microsoft SQL Server Compact Edition\4.0\ and when I use it in my SharpDevelop project I add a reference to C:\Program Files\Microsoft SQL Serve开发者_运维问答r Compact Edition\v4.0\Desktop\System.Data.SqlServerCe.dll

Then I use Git to push my project files to a Git repository. And on the other computer I clone the Git repository and pull the project files.

But now when I start SharpDevelop on the second machine, the referenced file C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Desktop\System.Data.SqlServerCe.dll can not be found.

So how should I solve this? Should I simply install SQL Server Compact Edition on the exact same path on second machine? or is there any better alternatives like adding the file to the Git repository?

Before I worked on a Java project in Eclipse, and then I added all external library files to the projects lib/ directory and added to the Git repository.


Put it in your Git repository and reference it from there.
That's the best way to have it available on all machines without having to install it on every single one.

Take a look at any open source project - they have all referenced files in their repository as well (usually in a folder called "libs" or something like that), because that's the only manageable way to deal with multiple developer machines all over the world and multiple dependencies.


EDIT:

Yes, exactly!

However, SQL Server CE needs more DLLs in order to work, not just the single one that you referenced!
I never used SQL Server CE myself, but according to this MSDN link (the second part, "Private file–based deployment") you need to put the following seven files in your project:

  • sqlceca35.dll
  • sqlcecompact35.dll
  • sqlceer35EN.dll
  • sqlceme35.dll
  • sqlceoledb35.dll
  • sqlceqp35.dll
  • sqlcese35.dll

I know, this is for SQL Server CE 3.5 and you are using 4.0, but I didn't find a similar explanation for 4.0.
I hope they didn't change that in v4.0 :-)


This forum thread explains how to define reference paths for the project. To make this configurable for each user, instead of storing those reference paths inside your .csproj file, you can tell SharpDevelop to store them inside the .csproj.user file.

In the "Reference Paths" tab of your project properties, to the left of the "Reference Paths" list box, there's a small button with the black bullet-point icon. When you press it, you get a pop-up menu in which you should select "Store in .user-file". That should allow you to keep reference paths in the .csproj.user file. This file wouldn't be versioned -- each user would configure it according to the way things are set up on his/her machine.


See this post about private deployment of version 4: http://erikej.blogspot.com/2011/02/using-sql-server-compact-40-with.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜