Visual Studio: Add Item / Add as link rather than just Add

Posted by Pete d'Oronzio on Stack Overflow See other posts from Stack Overflow or by Pete d'Oronzio
Published on 2010-04-07T15:12:53Z Indexed on 2010/04/07 15:33 UTC
Read the original article Hit count: 1391

Filed under:

I'm new to visual studio, coming from Delphi.

I have a directory tree full of .cs files (root is \Common).
I also have a directory tree full of Applications (root is \Applications)
Finally, I've got a tree full of Assemblies (root is \Assemblies)

I'd like to keep my .cs files in the Common tree and all the environment voodoo (solutions, projects, settings, metadata, debug data, bin, etc.) in the Assmblies tree. So, for a simple example, I've got an assembly called PdMagic.Common.Math.dll. The Solution and project is located in \Assemblies\Common\Math. All of its source (.cs) files are in \Common\Math. (matrix.cs, trig.cs, mathtypes.cs, mathfuncs.cs, stats.cs, etc.)

When I use Add Existing Item to add matrix.cs to my project, a copy of it is added to the \Assemblies\Common\Math folder. I just want to reference it. I don't want multiple copies laying around. I've tried Add Existing Item, and used the drop down to "Add link" rather than just "Add", and that seems to do what I want.

Question: What is the "best practice" for this sort of thing? Do most people just put those .cs files all in the same folder as the project? Why isn't "Add link" the default?

Thanks!

© Stack Overflow or respective owner

Related posts about VisualStudio