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, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

No comments: