<p>Many times I have seen Visual Studio solutions which have multiple projects that share source files.  These common source files are usually out in a common directory and in the solution explorer their icon shows up with a link arrow in the bottom left.</p>

<p>However, any time I try to add a source file to the project that is outside of that project's main directory, it just automatically copies it into the directory so that I no longer have  a shared copy.</p>

<p>I found that I can get around this by manually opening the project file in a text editor and modifying the path to something like "../../../Common/Source.cs"  but this is more of a hack then I would like.</p>

<p>Is there a setting or something I can change that will allow me to do this from within the IDE?</p>

[{'answer_id': 45664, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 6, 'selected': True, 'text': '<p>Right click on a project, select <strong>Add->Existing Item->Add as link</strong> (press on small arrow on Add button)</p>\n'}, {'answer_id': 45677, 'author': 'David Mohundro', 'author_id': 4570, 'author_profile': 'https://Stackoverflow.com/users/4570', 'pm_score': 2, 'selected': False, 'text': '<p>Thanks @aku!</p>\n\n<p>I knew this could be done, but I didn\'t know how to do this from Visual Studio. It shows up as a shortcut to the file and the csproj file generates the resulting XML like this:</p>\n\n<pre><code>&lt;Compile Include="..\\CommonAssemblyInfo.cs"&gt;\n  &lt;Link&gt;CommonAssemblyInfo.cs&lt;/Link&gt;\n&lt;/Compile&gt;\n</code></pre>\n\n<p>I\'ve seen this technique commonly used for common AssemblyInfo files to keep a consistent version.</p>\n'}]
['https://Stackoverflow.com/questions/45650', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/194/']