views:

282

answers:

3

My team member made a reference to a DLL on his local drive (e.g., C:\mystuff\thirdparty.dll) and checked in the project with the reference. I refreshed my local copy of the project and now I have a broken reference: <The system cannot find the reference specified>. I have the thirdparty.dll on my local machine, but it is not in the same directory my team member had it.

Should we be checking in thirdparty.dll itself into source control under our solution in a subdirectory using the relative path? When another developer gets the project, will it pull down the DLL and work automatically even if the developer didn't "install" the DLL beforehand?

Thanks.

+8  A: 

If you create a "lib" or "assemblies" directory under the solution, or at least in the source control project, and add all 3d party assemblies and reference them there, it should eliminate many problems like yours.

Generally, you won't have to use the 3d party installer, but that will depend on the product.

Michael Joseph Kramer
+2  A: 

See the answer I just gave to this question:

http://stackoverflow.com/questions/666597/tfs-c-vs2008-how-to-deal-with-external-assemblies/666623#666623

Basically, you need to add the DLL into source control, and reference it using file reference, such that the relative file path to the dll is the same for all developers on your team.

Ian Nelson
+1  A: 

From my experience the best way is to set some relative pathing to the referenced DLL in a common directory. For example, given the following structure:

  • Big Project
    • Project 1
    • Project 2
    • ...
    • Project N
    • Bin

I have all my projects compile into the bin folder, and all projects reference their dependencies from the bin folder. Anyone can pull down the project to ANY location and compile the first time.

Gavin Miller