Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

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: ,
Posted: Wednesday, November 26, 2008 3:00 AM by saraford

Comments

Antony said:

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

# November 26, 2008 10:21 AM

rv53705 said:

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?

# November 26, 2008 10:23 AM

Dennis J. Laney said:

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

# November 26, 2008 10:54 AM

Ryan said:

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

http://ryanwe.blogspot.com/2008/10/sharing-user-controls-between-web.html

# November 26, 2008 12:22 PM

hereafter said:

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

# November 26, 2008 9:11 PM

rv53705 said:

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

# November 27, 2008 8:21 AM

Chris Harang said:

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

# December 2, 2008 11:43 AM

Fredrik Tjärnberg said:

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.

# December 2, 2008 4:15 PM

Ray said:

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

# December 5, 2008 9:28 AM

xjb said:

# April 9, 2009 9:28 PM
New Comments to this post are disabled
Page view tracker