Adding or linking existing files to a project in Visual Studio .NET
This article was previously published under Q306234
This article has been archived. It is offered "as is" and will no longer be updated.
When you add a file to a project, you can either save the file to the project's folder, or you can link the file to the project. This article describes these options.
When you add an existing file to a project, the default option is to copy the file to the folder where your current project resides. If you want to instead link to the file (rather than actually moving the file to that folder) you can do so.
There is an important difference between these two options. If the file in question is shared between several projects and you want any changes that you make from any project to be reflected in the file, then you should link the file. If not, then you should copy the file so that each project has its own distinct copy. These options can be used in combination, but you should be careful to keep track of which project files are linked and which have been copied.
How to Specify the File Add OptionWhen you add an existing item to a project, you will be presented with the standard Open file dialog box. Look carefully at the Open button on this dialog box. You will see a drop-down arrow on the right edge of the button. Clicking on the arrow will display a list of three options:
- Open with
- Link file
Open with allows you to specify an alternative program to open the file with.
Link file leaves the file in its current location and maintains a link to the file from your current project.
Article ID: 306234 - Last Review: 12/06/2015 04:55:42 - Revision: 1.2
Microsoft Visual Studio .NET 2002 Professional Edition, Microsoft Visual Studio .NET 2003 Professional Edition
- kbnosurvey kbarchive kbvs2005doesnotapply kbvs2005swept kbhowto kbide kbinfo KB306234