How can I get Visual Studio to include all excluded files in a project

4.9k views Asked by At

I am working with a program called RoboHelp which auto generates a help documentation website. We use Visual Studio to check-in the generated files to TFS.

RoboHelp will add/edit/delete files. Visual Studio needs to pick up the changes before checking them in. My current process in Visual Studio is to Right-Click on the Solution Folder and run a "Compare". This operation brings up a grid of diffs comparing the local folder to TFS.

Using this process, I am able to get all my adds, edits, and deletes to appear in Pending Changes. However, the adds are not showing up as changes in the .csproj file. In the solution, they appear as excluded files. This is a massive site and it takes a good deal of time to open every folder and manually check for excluded files. Is there a way to tell Visual Studio to include every excluded file in the project?

2

There are 2 answers

0
Jason Williams On BEST ANSWER

If you exclude the entire folder from your project and then re-include it, it will go recursively through the files and add them all to your .csproj file. You will be able to maintain your TFS history on both the files and project.

0
MrHinsh - Martin Hinshelwood On

You should not check generated files into source control as it is a bad practice. They are generated.

Instead have a build process that executes the generation tool and puts the files into the drop location. They are the output and not the source.

You can use a .tfignore file to exclude all generated file location permanently in the same way that /bin and /obj are automatically excluded.