Link Files Between Different Projects - Visual Studio

You can add file to an existing project either by copying the files directly or create a link between them. When you create a link, the file does not get physically copied to a new location, only a reference is set to it. The process is quite simple as shown here.

Right click your project in Solution Explorer > Add > Existing Item. Browse to the file you want to add and click the small ‘drop-down’ arrow as shown below

image

Choose the ‘Add as Link’ option and the file will get added as a link, rather than directly adding the file to your project. Linked project items in Solution Explorer can be identified by the link indicator in its icon, as shown below.

image

Note: If the original file is deleted, the link gets broken. You also need to manually update a copy whenever changes are made to the original file.



Will you give this article a +1 ? Thanks in advance


About The Author

Suprotim Agarwal
Suprotim Agarwal, ASP.NET Architecture MVP (Microsoft Most Valuable Professional) works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He is the Editor of a Developer Magazine called DNC Magazine. He has also written two EBooks 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook

Follow him on twitter @suprotimagarwal

No comments: