MSBUILD build a project WITH the XML documentation files

msbuild

This should be easy, but I can't get it to work.

I have a web project, that references another project in my solution (lets call it Project1). Both projects are set to create XML documentation files.

When I right click the web project and build in Visual studio, my web/bin folder contains the XML doc files for both the web project and Project1.

I want exactly the same behavior in MSBUILD, so when I build I get both XML files in the bin folder, but I can't get it to play ball – what happens is that the XML file for the web project is created, but not for project1.

I've tried

  • MSBUILD the solution
  • MSBUILD the web project
  • /p:GenerateDocumentation=true doesn't work (on the solution or the web proj)

Help!

Best Answer

Gah. I got it.

I was specifying the Configuration (/p:Configuration=Release) but not a platform (/p:Platform="Any CPU"). So, it was choosing the x64 platform which is a platform I'd not ticked build XML documentation for.

TLD: Make sure you specify the configuration and the platform for the solution, and the XML docs will be created!