次の方法で共有


Linked Items in Projects

Keyboard:  SHIFT + ALT + A
Menu:  Project -> Add Existing Item
Command:  Project.AddExistingItem
Versions:  2008,2010
Published:  11/12/2010
Code:  vstipProj0022

 

You sometimes have a shared resource that you want to include in your project.  Traditionally, you would add the existing item (SHIFT + ALT + A) and it would make a copy for you:

image

 

 

However, did you know you can just link to the item instead?  Just go to the Add Existing Item dialog (SHIFT + ALT + A) and choose "Add As Link":

image

 

 

This will now put a link to the file in your project instead of making a copy:

image

 

 

Notice the arrow indicator much like you see on shortcuts.  The usual caveats apply here just like any shortcut such as making sure you understand that the path to file must be accessible for the file to be used among other things.

Comments

  • Anonymous
    February 20, 2011
    Can I make a copy of already linked item? I have added a existing project to my current project. This did not make a copy of that in my solution instead it uses this as a reference. Can I make the linked project copied to my  current solution to remove the dependency?