views:

400

answers:

4

As an example, I'm trying to add a reference to WatiN in Visual Studio 2008. I download WatiN and I have a folder on my desktop containing 5 files:

  • WatiN.Core.dll
  • WatiN.Core.xml
  • Interop.SHDocVw.dll
  • Microsoft.mshtml.dll
  • WatiN.Core.UnitTests.dll
  • WatiN.Core.UnitTests.dll.config

I can add my reference to WatiN.Core.dll and start coding in Visual Studio. But I have some questions:

  • Can I now delete the folder on my desktop? Were the files copied to the project bin?
  • What happens when I check my project into source code and another developer checks it out? Does he/she have to have the same folder on their desktop.

My thought was to create a lib folder in the project and reference the files in the lib folder. This folder will get added to source control so that everything should work for the next developer. But I have some questions about this solution:

  • Do I need all 6 of those files?
  • I believe the .config files have something to do with intellisense, but the project will build and run without them right?
  • How do I know what files to include apart from the WatiN.Core.dll. The project builds and runs with only WatiN.Core.dll and Interop.SHDocVw.dll. How am I meant to know what the dependencies are?

Any insight is much appreciated.

A: 

I believe you can only delete the folder if you are referencing the file directly from the bin folder (cut and pasted it there). If you are referencing the file from the folder than I believe you need to keep it there.

You may run into problems deleting the other files if the dll your referencing, references the classes in the other dll's.

Hunter
+1  A: 

I would create a developement tree with all source files, library files, tools, docs, resources so that any developer can get a working project straight from source control without having to search for references.

Having referenced DLLs in a lib folder means that projectA is able to use version 1.0 of the DLL and projectB is able to user version 2.0 of the DLL.

When the solution builds it will get the DLLs from where they are referenced. If it cant find them the project wont build.

Have a look at the following articles.

http://www.codeplex.com/treesurgeon

As for which dlls you need to reference, you can go the way of only referencing what you need.

skyfoot
+2  A: 

Adding a reference does just that. It adds a reference, so if the reference is to your desktop folder other developers will not be able to see the files. Also, if you delete the files you will have dangling references in your project. In general, don't reference files on your desktop.

Making a lib folder in the same source control tree as the project as you have suggested is a much better solution. Visual Studio will store the references as relative paths enabling other developers to compile the project.

You will have to study the documentation for the WatiN library to know which files are required by your application. You should not delete the .config file as it is not related to intellisense.

Martin Liversage
+1  A: 

WATiN needs the WATiN.Core.dll and the Interop.SHDocVw.dll in order to run. As others have suggested, it's best to have a lib folder in your source control tree for external libraries so everyone can use relative references.

TreeSurgeon, mentioned above, is a good tool or you can at least use their folder structure as a model.

The Watin.Core.xml file should give you intellisense if you put it in the bin with the dll.

Leslie