Visual Studio – Should XmlDocument.xml Be Included in Source Control

team-foundation-servervisual studio

In a Web API 2 project, in the project properties, I have enabled the output of an XML documentation file.

By default, Visual Studio 2013 wants to check this into TFS. I'm pretty sure that I'm going to exclude it, but wondered what the general opinion is on this?

Best Answer

If a file 'X' can be thrown away and always completely re-generated from files that are in source control, then the general rule is that file 'X' should not be placed in source control.

The main exceptions to this rule are:

  • There are rare scenarios where the file needs to be edited manually and those edits need to be preserved.
  • If generating the file is time consuming or otherwise costly/inconvenient and the file is expected to change only rarely. In this case can it be beneficial to put the file under source control anyway to speed up the build process.