I often need to add the source code content of a whole directory to my Visual Studio 2005 projects.

That's the case when I use OlyMars for my own developement projects. Usually, what I need is to add a link to the source files that have been generated by OlyMars. I want this as a link because I want to be sure that my custom projects using the generated code are always up to date even if I regenerate the code.

If you simply drag and drop a folder in Visual Studio 2005, an actual copy of the files is made, not a link to them. 

This is precisely why I have written a Visual Studio 2005 AddIn named Add Directory Content

To download the latest version of this FREE AddIn : http://www.msfrancedev.net/AddDirectoryContent/AddDirectoryContentSetup.msi

Once installed, its use is very very simple. First, open your Visual Studio project. Then, create a directory in your project structure which will host the linked files. You can skip this directory creation if you like. In this case, the files will be added to your project root. To run this AddIn, all you have to do is to go to your Visual Studio 2005 Tools menu and hit the Add Directory Content menu.

Then, locate the directory where your source code is stored. You can include the subdirectories by checking the corresponding CheckBox. This AddIn can also recreate the same folder structure in your Visual Studio 2005 project than in your actual directory. Finally, you can filter the files to be added to your projects.

At the end of the process, a quick summary is displayed.

You are done ! All the files were correctly added to your project and now, each time the original files are changed, your project will pickup the changes right away!

Note that if you try to add an existing file to your project, an error message will be generated. You can treat this as a simple warning. No harm here.

If you have any feedback on this AddIn, you can use the Comment section of this post.

Enjoy !