Minimal reproduction for dotnet/docfx#11046.
docfx metadata fails for Blazor component projects when running with .NET SDK 10.0.2xx (200-band).
The Razor compiler analyzer requires Roslyn 5.3.0, but DocFx 2.78.5 bundles an older version.
- .NET SDK 10.0.2xx (e.g.
dotnet --version→10.0.201) - DocFx 2.78.5 (
dotnet tool install -g docfx --version 2.78.5)
# 1. Verify the project builds successfully
dotnet build src/ReproLib/ReproLib.csproj
# 2. Run docfx metadata — this fails
docfx metadata docs/docfx.jsondocfx metadata succeeds.
warning: FailedToLoadAnalyzer: Failed to load .NET Analyzer.
AnalyzerName: Microsoft.CodeAnalysis.Razor.Compiler
ErrorCode: ReferencesNewerCompiler
ReferencedCompilerVersion: 5.3.0.0
error CS0115: 'Component1.OnInitialized()': no suitable method found to override
Build failed.
2 warning(s)
1 error(s)
The Razor source generator cannot load, so it does not produce the generated partial class for Component1.razor.
The code-behind file (Component1.razor.cs) overrides OnInitialized() from ComponentBase, but without the generated partial class the inheritance chain is missing — causing CS0115.
Pin the SDK to the 100-band via global.json:
{
"sdk": {
"version": "10.0.103",
"rollForward": "disable"
}
}