We pay for user submitted tutorials and articles that we publish. Anyone can send in a contributionLearn More
When we work on big projects, there is a need to set up a development tree (directory structure) and not just put everything in the bin\Debug or bin\Release folder. There are some “how to set up a good development tree” best practices and even a .NET development tree generator called Tree Surgeon. Some of the folders in this directory structure shall be “Resources” (set of icons and images) and “Config” (set of configuration files).
How many times did you search for a specific configuration file or a specific icon in the development tree (assuming it is a big one)? You come back to a component you wrote several years ago and can’t recall where did you locate your files. Wouldn’t it be nice if for each project, our resources and configuration files could be seen form visual studio? We would never need to find them using the windows explorer anymore and we will always have them right there even when coming back to a code which was written 2-3 years ago.
So, my advice is to add 2 additional folders to your Visual Studio project called “Resources” and “Config files”. Then, Add the appropriate files to those folders. I am not talking about embedding your resources into the assembly (cause a significant increase to the size of your executable, but you sometimes need it) but about adding those files as references. To achieve that goal, do the following: after choosing to add an existing item, click on the arrow on the “Add” button and choose “Add As Link”:
Your project will eventually look like this:
Notice that those are only references to the files, but you can easily tell which configuration files are used by your project. This post didn’t teach you new tricks, except for the “Add As Link” option maybe. But from my experience, most of my co-workers (including me) didn’t use that advice before. what do you think about it? Do you find it helpful?
Tags :add as linkconfigurationdevelopment treefilesprojectReferenceresourcesVisual Studio
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd