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 solutionMSBUILD
the web project/p:GenerateDocumentation=true
doesn't work (on the solution or the web proj)Help!
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio.
To build a specific target of a specific project in a solution. At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute.
NET Framework use MSBuild project files to describe and control the application build process. When you use Visual Studio to create an MSBuild project file, the appropriate XML is added to the file automatically.
Visual Studio determines the build order and calls into MSBuild separately (as needed), all completely under Visual Studio's control. Another difference arises when MSBuild is invoked with a solution file, MSBuild parses the solution file, creates a standard XML input file, evaluates it, and executes it as a project.
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!
On my end the XML was generated when building locally in VS, but NOT using MSBuild Task on TFS / Azure DevOps.
The "magic" part is to specify the p:/DocumentationFile
parameter.
In my working scenario it is: /p:DocumentationFile="$(ApplicationName).xml"
Thus the file comes out to the output directory along with project dlls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With