Xml2Doc.MSBuild 1.4.0-preview.93-g8d985ca

This is a prerelease version of Xml2Doc.MSBuild.
There is a newer prerelease version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xml2Doc.MSBuild" Version="1.4.0-preview.93-g8d985ca">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xml2Doc.MSBuild" Version="1.4.0-preview.93-g8d985ca" />
                    
Directory.Packages.props
<PackageReference Include="Xml2Doc.MSBuild">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xml2Doc.MSBuild --version 1.4.0-preview.93-g8d985ca
                    
#r "nuget: Xml2Doc.MSBuild, 1.4.0-preview.93-g8d985ca"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Xml2Doc.MSBuild@1.4.0-preview.93-g8d985ca
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xml2Doc.MSBuild&version=1.4.0-preview.93-g8d985ca&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Xml2Doc.MSBuild&version=1.4.0-preview.93-g8d985ca&prerelease
                    
Install as a Cake Tool

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 the dotnet SDK MSBuild

This means:

  • Building from VS UI / MSBuild.exe → task runs on net472.
  • Building from dotnet build → task runs on net8.0.

Output Markdown is identical regardless of host TFM. The package maps to the appropriate Xml2Doc.Core target 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 net472 task 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 the net8.0 target).

  • Recommended pattern:

    dotnet build MySolution.sln -c Release
    
  • Outputs 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 .csproj or via /p:Xml2Doc_Enabled=false.

Versioning / Support

  • Task hosts: net472 (VS/MSBuild.exe), net8.0 (dotnet SDK).
  • Backed by Xml2Doc.Core targets: netstandard2.0;net8.0;net9.0 with identical rendering across TFMs.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed