Xml2Doc.MSBuild
1.4.0-preview.93-g8d985ca
See the version list below for details.
dotnet add package Xml2Doc.MSBuild --version 1.4.0-preview.93-g8d985ca
NuGet\Install-Package Xml2Doc.MSBuild -Version 1.4.0-preview.93-g8d985ca
<PackageReference Include="Xml2Doc.MSBuild" Version="1.4.0-preview.93-g8d985ca"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Xml2Doc.MSBuild" Version="1.4.0-preview.93-g8d985ca" />
<PackageReference Include="Xml2Doc.MSBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Xml2Doc.MSBuild --version 1.4.0-preview.93-g8d985ca
#r "nuget: Xml2Doc.MSBuild, 1.4.0-preview.93-g8d985ca"
#:package Xml2Doc.MSBuild@1.4.0-preview.93-g8d985ca
#addin nuget:?package=Xml2Doc.MSBuild&version=1.4.0-preview.93-g8d985ca&prerelease
#tool nuget:?package=Xml2Doc.MSBuild&version=1.4.0-preview.93-g8d985ca&prerelease
Xml2Doc.MSBuild
MSBuild integration for Xml2Doc, part of the mod-posh organization.
Overview
Xml2Doc.MSBuild adds automatic documentation generation to your build.
After a successful compile, it converts the compiler-generated XML docs into Markdown using Xml2Doc.Core.
Multi-framework support (task host)
The task assembly is multi-targeted:
net472— used by Visual Studio 2022 MSBuild (full .NET Framework host)net8.0— used by thedotnetSDK MSBuild
This means:
- Building from VS UI / MSBuild.exe → task runs on
net472. - Building from
dotnet build→ task runs onnet8.0.
Output Markdown is identical regardless of host TFM. The package maps to the appropriate
Xml2Doc.Coretarget under the hood.
Setup
Add a package reference to your project:
<ItemGroup>
<PackageReference Include="Xml2Doc.MSBuild" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>
That’s it—on successful build, docs are generated according to the properties below.
Configuration (MSBuild properties)
| Property | Description |
|---|---|
Xml2Doc_Enabled |
Enable/disable generation. Default: true. |
Xml2Doc_SingleFile |
true = generate one combined Markdown file; false = per-type files. |
Xml2Doc_OutputFile |
Output file path when SingleFile=true (e.g. $(ProjectDir)docs\api.md). |
Xml2Doc_OutputDir |
Output directory when SingleFile=false (e.g. $(ProjectDir)docs). |
Xml2Doc_FileNameMode |
verbatim (keep generic arity) or clean (friendly generic names). |
Xml2Doc_RootNamespaceToTrim |
Optional namespace prefix trimmed from display names. |
Xml2Doc_CodeBlockLanguage |
Code block language for fenced blocks (default csharp). |
Examples
Single file (good for READMEs / wikis)
<PropertyGroup>
<Xml2Doc_SingleFile>true</Xml2Doc_SingleFile>
<Xml2Doc_OutputFile>$(ProjectDir)docs\api.md</Xml2Doc_OutputFile>
<Xml2Doc_FileNameMode>clean</Xml2Doc_FileNameMode>
<Xml2Doc_RootNamespaceToTrim>MyCompany.MyProduct</Xml2Doc_RootNamespaceToTrim>
</PropertyGroup>
Per-type files (good for large APIs)
<PropertyGroup>
<Xml2Doc_SingleFile>false</Xml2Doc_SingleFile>
<Xml2Doc_OutputDir>$(ProjectDir)docs</Xml2Doc_OutputDir>
<Xml2Doc_FileNameMode>clean</Xml2Doc_FileNameMode>
</PropertyGroup>
Only generate in Release
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Xml2Doc_Enabled>true</Xml2Doc_Enabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Release'">
<Xml2Doc_Enabled>false</Xml2Doc_Enabled>
</PropertyGroup>
Visual Studio notes
- The package includes a
net472task so it runs inside Visual Studio 2022 builds without extra tooling. - If you don’t see output, check Build Output for the Xml2Doc task messages and verify your project emits XML docs (
<GenerateDocumentationFile>true</GenerateDocumentationFile>).
CI notes
Works with
dotnet build(task will load thenet8.0target).Recommended pattern:
dotnet build MySolution.sln -c ReleaseOutputs are reproducible across hosts (VS vs. dotnet).
Troubleshooting
- No files produced: ensure your project actually generates an XML doc file for the build config/TFM in use.
- Want to disable temporarily? Set
<Xml2Doc_Enabled>false</Xml2Doc_Enabled>in your.csprojor via/p:Xml2Doc_Enabled=false.
Versioning / Support
- Task hosts:
net472(VS/MSBuild.exe),net8.0(dotnetSDK). - Backed by
Xml2Doc.Coretargets:netstandard2.0;net8.0;net9.0with identical rendering across TFMs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Xml2Doc.MSBuild:
| Package | Downloads |
|---|---|
|
Yaml2Doc.Markdown
Renderer library that converts the neutral pipeline model into human-friendly Markdown documentation. |
|
|
Yaml2Doc.Core
Core library for parsing pipeline YAML into a neutral model for documentation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.4.0-preview.98-g5ab3c0c | 42 | 3/15/2026 |
| 1.4.0-preview.97-g6b55cdc | 39 | 3/15/2026 |
| 1.4.0-preview.96-gd4b8414 | 43 | 3/15/2026 |
| 1.4.0-preview.95-g36489cc | 38 | 3/15/2026 |
| 1.4.0-preview.94-g95a0d96 | 43 | 3/15/2026 |
| 1.4.0-preview.93-g8d985ca | 41 | 3/15/2026 |
| 1.4.0-preview.92-g16d5460 | 42 | 3/15/2026 |
| 1.4.0-preview.91-gdc7994e | 46 | 3/14/2026 |
| 1.4.0-preview.90-g773c9bc | 45 | 3/14/2026 |
| 1.4.0-preview.89-g412955a | 46 | 3/14/2026 |
| 1.4.0-preview.88-gd4339e3 | 41 | 3/14/2026 |
| 1.4.0-preview.87-g762e834 | 46 | 3/14/2026 |
| 1.4.0-preview.86-g10fb1f6 | 270 | 12/17/2025 |
| 1.4.0-preview.85-g20398c2 | 249 | 12/17/2025 |
| 1.4.0-preview.84-g14ae0ae | 254 | 12/17/2025 |
| 1.4.0-preview.83-g7ca4dad | 249 | 12/17/2025 |
| 1.4.0-preview.82-gccf3c5b | 257 | 12/17/2025 |
| 1.4.0-preview.81-ga03f733 | 273 | 12/17/2025 |
| 1.4.0-preview.80-g111a6ac | 280 | 11/7/2025 |
| 1.3.1 | 317 | 10/26/2025 |