Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 516
Anders Gustafsson Avatar asked Aug 01 '12 20:08

Anders Gustafsson


People also ask

How do I add a link to a file in Visual Studio?

To add a file as a link, right click and choose Add > Existing Item… as before, but this time, don't click the Add button. Instead, click the little dropdown arrow next to the Add button and select Add as Link. Instead of copying the file into the project directory, Visual Studio will create a link to the original.

How do I add a code to an existing Visual Studio project?

On Linux, the existing file can be inserted by copying to system's clipboard then paste from VSC. Then paste to VSC as usual using Ctrl-V.


1 Answers

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.

like image 148
Erdogan Kurtur Avatar answered Oct 18 '22 09:10

Erdogan Kurtur