This page explains how docfx targets multiple .NET versions simultaneously, how framework-conditional package versions are resolved, how the CI test matrix exercises each framework, and how InternalsVisibleTo is wired across the build. For information about the NuGet package management system that underlies version pinning, see Central Package Management. For information about the GitHub Actions workflows that execute the CI matrix, see GitHub Actions Workflows.
All docfx projects target three .NET frameworks in parallel: net8.0, net9.0, and net10.0. A single build produces three sets of output assemblies. Tests are run against all three frameworks in CI. Releases are published exclusively against net10.0.
The strategy is controlled by three layered MSBuild property files:
| File | Scope | Purpose |
|---|---|---|
Directory.Build.props (root) | All projects | Sets TargetFrameworks, compiler version, globalization settings |
src/Directory.Build.props | src/ projects | Inherits root; adds InternalsVisibleTo for test assembly |
test/Directory.Build.props | test/ projects | Inherits root; disables parallel TFM testing, configures test loggers |
Directory.Packages.props | All projects | Central package versions, with per-framework conditionals |
The root Directory.Build.props sets TargetFrameworks to net8.0;net9.0;net10.0 for every project in the repository. Because this property is set at the directory root, no individual .csproj file needs to declare it.
Key properties set here:
| Property | Value | Effect |
|---|---|---|
TargetFrameworks | net8.0;net9.0;net10.0 | Every project multi-targets all three frameworks |
LangVersion | Preview | Enables preview C# language features across all TFMs |
ImplicitUsings |