Did you know… How to add a Linked Item to a project – #365

This feature is helpful when you need a common file shared among projects, like a bitmap, readme, set of common tools and utilities, etc.

To add, right-click on the project in the solution explorer, and select Add – Existing Item.  You’ll notice the “Add” button is one of those button-dropdowns.  Drop down the Add button and select Add a link

Add Existing Item with Add as Link selected

Now you have a linked item in your project as indicated by the shortcut icon.

Linked item in Solution Explorer

The location of the linked file is saved in the project file.  The location must be via the file system, either on different drives or UNC.  No http or ftp.

Technorati Tags: VS2005Tip,VS2008Tip

Comments (10)

  1. Antony says:

    This doesn’t seem to work for C++. I only get a basic Add button without the arrow. Am I doing something wrong?

  2. rv53705 says:

    So, if you add a link, this will only works when the path exists, if you give the source to anyone else, and path doesn’t exist, linked item won’t work. Am i right?

  3. Dennis J. Laney says:

    Great post.  Does this work with aspx pages or master pages?

  4. Ryan says:

    This also makes for a great way to share asp user controls between web projects.


  5. hereafter says:

    Saw ppl using this in videos, did not know exactly how, thanks, a very helpful tips

  6. rv53705 says:

    @Antony: It’s true, on Visual C++ doesn’t work, Add a link isn’t available.

  7. Chris Harang says:

    But why is this feature so hidden that it needs a special blog post?  🙂  Hi Sara, long time, good to know you’re still rockin.

    – Chris

  8. We use this feature to link in common assembly attributes (like assembly version, product and company information etc). Very useful! Since I was not aware of the GUI way of doing this I did it by modifying the project file directly. Thanks for the tip, next time around I might do it the click-and-browse way.

  9. Ray says:

    Is this available for C# projects – the Add button doesn’t have any selection?