Search code examples
c#visual-studioprojects-and-solutions

"Add existing item" in Visual Studio: is it possible to make "Add as link" default?


As pointed out in this SO answer, the Add > Existing item dialog in Visual Studio by default displays the Add button (meaning that the selected items will be physically copied to the new location), whereas the desirable action is often (always?) to Add as Link.

Is it possible to configure Visual Studio so that Add as link is selected by default when opening the Add > Existing item dialog?

I have thoroughly searched the Options dialog in Visual Studio and examined the MSDN documentation for an answer to this, but so far to no avail.

Project Linker would be a good option for automated linking when two new projects are to share the same code base. However, when linking a large number of files from an existing to a new project, one seems to be confined to the Add > Existing item approach, and this work could be much more convenient and less prone to error if Add as link would be the default action.


Solution

  • Unfortunately, there is no option for that. But there is silver lining. You can drag files to a project and drop them to desired folder. Files are copied to your project. If you press Alt key doing drag and drop operation, files are not copied but linked instead.