Search code examples
visual-studioversion-controlreferencewatin

Adding a Visual Studio reference to a product under source control


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.


Solution

  • 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.