docfx icon indicating copy to clipboard operation
docfx copied to clipboard

chore: Add support for .NET 10 target framework

Open filzrev opened this issue 2 months ago • 4 comments

This PR intended to add support for .NET 10.

  • Add target framework net10.0 to TargetFrameworks. (It increase NuGet package size)
  • Migrate base target framework from net8.0 to net10.0
  • Update GitHub Actions workflow settings

What's Changed in this PR

action.yml

  • Update actions/setup-node version
  • Update actions/setup-dotnet version
  • Add setting to install .NET 10

ci.yml

  • Add dotnet test step for .NET 10.
  • Modify existing dotnet test step for .NET 8 run on ubuntu only.
  • Modify Percy test step to use .NET 10
  • Modify Snapshot test steps to use .NET 10

lint.yml

  • Remove unused actions/setup-dotnet step.

release.yml

  • Change Self-contained package .NET version to .NET 10.
  • Modify actions/setup-dotnet settings to install .NET 10
  • Update Sign CLI version and add comment. (It can't dotnet nuget sign command. and required to run on Windows)

nightly.yml

  • Remove step setup-dotnet (.NET 10 SDK is installed by setup-dotnet step instead)
  • Add test step for .NET 9

snapshot.yml

  • Update dotnet test target framework to use .NET 10

Directory.Build.Props

  • Add net10.0 target framework. (It's expected to increase NuGet package size)
  • Comment out settings for DOCFX_PREVIEW_BUILD (It's re-enabled when testing .NET 11)
  • Remove old comment for NU5104.

Directory.Packages.Props SymbolFormatter.*.cs

  • Update Roslyn packages to 5.0.0
  • Note: To support C# 14 feature (e.g. extension members) it need to add code on docfx side.

*.csproj

  • Update TargetFramework from net8.0 to net10.0

filzrev avatar Oct 23 '25 14:10 filzrev

Any chance to merge this and release yesterday? Thanks. 🙂

VaclavElias avatar Nov 12 '25 22:11 VaclavElias

This PR intended to support for .NET 10 SDK and Roslyn 5.x. But it's not supporting to generating API metadata that using C# 14 features.

It need to additional tasks to generating HTML site that support for C# 14 features

filzrev avatar Nov 12 '25 22:11 filzrev

I see. For some reason, I can't build (SDK resolver issue) Stride docs (https://github.com/stride3d/stride-docs/issues/430) with the latest (or previous) docfx version. I am targeting .NET 10 now and when I use your PR, it works 🙂. I will try docfx custom build with your PR merged temporarily, till this is merged and released 🤷‍♂️.

VaclavElias avatar Nov 12 '25 23:11 VaclavElias

Can this be merged and released, then add support for new language features later?

I'm asking because building my codebase on .NET 10 currently doesn't work due to the following errors:

  • error CS8652: The feature 'unbound generic types in nameof operator' is currently in Preview and unsupported. To use Preview features, use the 'preview' language version.
  • warning: No .NET API detected for .

It's understandable that DocFX can't yet handle the new C# features, such as extension blocks and new conversion operators, because they affect the public API and require code changes that may take some time. This is why I'm postponing such changes in my codebase. So, if DocFX would only update to the latest Roslyn assemblies and release that, my problem would be solved, and I'm no longer blocked from releasing a .NET 10-compatible version.

~Edit: Well, I'm also dependent on #10850.~ It looks like that fix has already been merged.

bkoelman avatar Nov 21 '25 04:11 bkoelman