Should I add .vcxproj.filter files to source control?

I just found that if you use Git you can mark .filter files to be treated as a union for merging to make it simpler. Just add the line:

*.vcxproj.filters merge=union

to your .gitattributes file.

See Using .gitattributes to avoid merge conflicts for more details.


We intentionally pulled the .filter. file information out of the .vcproj when we translated to the .vcxproj MSBuild format. One reason is exactly what you pointed out, that the filters are purely a logical view, and different team members may want different views. The other is that sometimes the build is set up to check the timestamp of the project file, and trigger a rebuild if it has changed - because that may mean there are different source files to build, or different settings, etc. I don't recall if we actually shipped with the build trigging that way, but the idea was that we did not want to trigger a rebuild simply because the filters changed, as they don't affect the build.


Previous versions of Visual Studio (at least versions 6.0 and 2008) store that information in their own project file (.dsp and .vcproj files respectively), which of course is good to add to SCC.

I cannot think of any reason to not include this .filter files in SCC