tags:

views:

43

answers:

1

I have two .NET library projects in Visual Studio 2008 that both make use of the MySql Connector for .NET (MySql.Data.dll). These libraries are then in turn both used by a .NET command line application which also uses the Connector. The library projects are pulled in to the application's solution as git submodules and referenced by project in Visual Studio.

I'm looking for the most effective strategy for storing and referencing the MySql Connector library.

I have tried having the MySql.Data.dll checked in to all three projects (in their root folder), this was problematic when one project changed to a newer version of the connector dll. Although each project had its own version of the dll, only one was packaged into the resultant application leading to an API mismatch which was hard to pin down. This has put me off this approach.

I have tried having the command line application reference the connector dll that is held in a submodule, however this only removes the possibility of version mismatches when there is only one submodule rather than two as in this case.

I am contemplating putting the dll in the global assembly cache (GAC) of all machines that need to build or use the application, but I'm wary of not having all dependencies for an application available in source control.

A: 

I usually have a folder called extlib or dependencies and place all the third party dlls in that folder. This will reside along side the root folder of all three projects and will be copied over into bin folders as a post build step.

Why don't you have something like

main/project1
main/project2
main/project3
main/extlib

and basically project1-3,extlib are all separate git repositories.

CodeToGlory
when you say "This will reside along side the root folder of all three projects", I don't see how you can do that with git.The two library projects are completely unaware of each other, and you can check them out to to any location on you system.
Tim Abell
I think he means to reference extlib in each project as a submodule. Then updates to the dll can be published to extlib and your projects then just have to do a `git submodule update` to update to it.
Sam Pearson
Regarding your 4th paragraph: all 3 projects should be referencing the dll repository as a submodule: the command line app and each library project.
Sam Pearson