Thursday, May 30, 2013

Add As Link

Right-clicking in a project in the Solution Explorer in Visual Studio 2012 and then picking Add > Existing Item... ...will naturally let you add a class to a project. In the dialog box that appears, where you browse for a file, the "Add" button will have a little down arrow by it. If you click the down arrow, you will see a little menu with these options:

  1. Add
  2. Add As Link
  3. Show previous versions

 
 

Picking the "Add As Link" option will allow you to create a link to the file instead of including the file in the project at hand. When you update the file at its own project the changes will be usable immediately at the project linking it in, yet when you compile the project linking in the file, the code ends up in the .dll for the project linking the file in and there is not a scenario in which .dll will look to another .dll for a referenced file. In the case of class, there is a different icon for classes that are really in a project from those which are linked in. The former is a green "C#" and the latter is a green "C#" with a blue box with a dot in it laid over its lower right.

No comments:

Post a Comment