docfx: MacOS docfx broken between 2.51 and 2.52
Operation System: (Windows or Linux or MacOS)
MacOS
DocFX Version Used: 2.52
#5637 introduced a new version of the FSharp compiler service (34.1.1), which seems to be incompatible with MacOS / mono fork of MSBuild (or does this now require an update to mono?). I used git bisect to track it down to this changeset: ffba7056.
The error received is:
20-04-16 03:21:06.424]Info:[MetadataCommand]Completed Scope:MetadataCommand in 705.8239 milliseconds.
[20-04-16 03:21:06.424]Error:Error extracting metadata for /Users/amir/Library/Application Support/unity/editor/documentation/build/com.unity.package-manager-doctools@1.1/package/solution.csproj: System.NullReferenceException: Object reference not set to an instance of an object
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00535] in <8a8478fd5e284acdb5322455028f571a>:0
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x00106] in <8a8478fd5e284acdb5322455028f571a>:0
[20-04-16 03:21:06.424]Info:Completed in 709.2319 milliseconds
but this is simply because the project loader fails to load the project.
For now we’ll have to stick with 2.51 until this is fixed.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 18 (5 by maintainers)
Commits related to this issue
- Added temporary fix as workaround to https://github.com/dotnet/docfx/issues/5785 — committed to linksplatform/Scripts by Konard 4 years ago
- Revert back to v2.45.1 See #7, #1 and dotnet/docfx#5785 — committed to nikeee/docfx-action by nikeee 4 years ago
- update docfx version https://github.com/dotnet/docfx/issues/5785 — committed to halomakes/GravyIrc by halomakes 4 years ago
- (docs) Add basic docfx site (#80) This is now live at https://perlang.org — committed to perlang-org/perlang by perlun 4 years ago
- Bump docfx to 2.56.4 Now that https://github.com/dotnet/docfx/issues/5785 is resolved — committed to npgsql/doc by roji 4 years ago
- Bump docfx to 2.56.4 Now that https://github.com/dotnet/docfx/issues/5785 is resolved — committed to npgsql/doc by roji 4 years ago
I am seeing the same on Linux with version 2.52. A downgrade to 2.51 also solved it for me.
fixed in 2.56.4
Hi All, We have applied the fix and generated test version docfx, would you please give a try with the docfx and let us know if you still meet any issue? Thanks!
Click here to download the docfx with the issue fixed
Seeing same issue on Mono 6.10.0.104 with docfx 2.56.2.0
Came across the issue with MacOS 10.15.6 an using mono 6.10.0.104. Also, downgrading to docfx 2.51 made it work. As this should also work on our build agents, fixing this in the upcoming version is very much appreciated. Installing/downgrading to an older version with Homebrew is not funny. Looking forward to have this working again. Thanks!
@awegg @amirebrahimi how to install docfx 2.51 version on Mac ? When I run brew install docfx, it installs the latest version.
Some additional information:
The previous release, 2.51 works, both for our own projects and for the DocFX Seed project. 2.52 does work for the same projects on Windows.
With 2.52 (downloaded as a zip from the releases tab), generating the docs for the DocFX Seed project shows warnings about the project files in the command line output and the results are missing any HTML for the C# API files. An example warning is, “… SampleClass1.sln: Could not resolve type with token 010000ed from typeref (expected class ‘Microsoft.Build.Construction.SolutionFile’ in assembly ‘Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’)”
For our own projects, the command line output shows exceptions thrown relating to the project file and nothing is generated. First there is a warning, “Unity.Entities.csproj: The type initializer for ‘Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer’ threw an exception… Ignored.” This is followed later with a NULL reference exception (shown below).
The full DocFX Seed command line output: ` charleswMBP13TB:dfxtest charlesw$ mono …/docfx-2.52/docfx.exe docfx-seed/docfx.json --serve [20-04-16 02:20:12.776]Info:[MetadataCommand.ExtractMetadata]Using mono /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/15.0/bin/MSBuild.dll as inner compiler. [20-04-16 02:20:12.902]Info:[MetadataCommand.ExtractMetadata]Loading projects… [20-04-16 02:20:13.435]Warning:MetadataCommand.ExtractMetadataError opening solution /Users/charlesw/Documents/dfxtest/docfx-seed/src/SampleClass1/SampleClass1.sln: Could not resolve type with token 010000ed from typeref (expected class ‘Microsoft.Build.Construction.SolutionFile’ in assembly ‘Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’). Ignored. [20-04-16 02:20:13.454]Info:[MetadataCommand.ExtractMetadata]Cache for /Users/charlesw/Documents/dfxtest/docfx-seed/src/SampleClass1/SampleClass1.sln in /Users/charlesw/Documents/dfxtest/docfx-seed/src/SampleClass1/obj/xdoc/cache/final/645371506 is corrupted, rebuild… [20-04-16 02:20:13.454]Info:[MetadataCommand.ExtractMetadata]Generating metadata for each project… [20-04-16 02:20:13.460]Warning:[MetadataCommand.ExtractMetadata]No metadata is generated for . [20-04-16 02:20:13.479]Info:[MetadataCommand]Completed Scope:MetadataCommand in 735.2815 milliseconds. [20-04-16 02:20:13.608]Info:[BuildCommand]6 plug-in(s) loaded. [20-04-16 02:20:13.613]Info:[BuildCommand]Post processor ExtractSearchIndex loaded. [20-04-16 02:20:13.624]Info:[BuildCommand]No files are found with glob pattern **/*.yml, excluding , under directory “/Users/charlesw/Documents/dfxtest/docfx-seed/obj/api” [20-04-16 02:20:13.651]Info:[BuildCommand]Markdown engine is markdig [20-04-16 02:20:13.782]Info:[BuildCommand.BuildCore.Build Document]Max parallelism is 4. [20-04-16 02:20:14.341]Info:[BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor]Building 3 file(s) in TocDocumentProcessor(BuildTocDocument)… [20-04-16 02:20:14.341]Info:[BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ResourceDocumentProcessor]Building 1 file(s) in ResourceDocumentProcessor(ValidateResourceMetadata)… [20-04-16 02:20:14.341]Info:[BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.ConceptualDocumentProcessor]Building 0 file(s) in ConceptualDocumentProcessor(BuildConceptualDocument=>CountWord=>ValidateConceptualDocumentMetadata)… [20-04-16 02:20:14.341]Info:[BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.RestApiDocumentProcessor]Building 10 file(s) in RestApiDocumentProcessor(BuildRestApiDocument=>ValidateRestApiDocumentMetadata=>ApplyOverwriteDocumentForRestApi)… [20-04-16 02:20:14.355]Warning:BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocumentUnable to find either toc.yml or toc.md inside obj/api/. Make sure the file is included in config file docfx.json! [20-04-16 02:20:15.009]Info:[BuildCommand.BuildCore.Build Document.LinkPhaseHandlerWithIncremental.Apply Templates]Applying templates to 6 model(s)… [20-04-16 02:20:15.257]Info:[BuildCommand.BuildCore.Build Document]XRef map exported. [20-04-16 02:20:15.380]Info:[BuildCommand.Postprocess.HandlePostProcessorsWithIncremental.HandlePostProcessors.Processing ExtractSearchIndex]Extracting index data from 7 html files [20-04-16 02:20:15.474]Info:[BuildCommand.Postprocess]Manifest file saved to manifest.json. [20-04-16 02:20:15.499]Info:[BuildCommand]Completed building documents in 1885.5855 milliseconds. Serving “/Users/charlesw/Documents/dfxtest/docfx-seed/_site” on http://localhost:8080
[20-04-16 02:24:02.679]Info:[BuildCommand]Completed Scope:BuildCommand in 229199.6742 milliseconds. [20-04-16 02:24:02.679]Info:Completed in 229937.8832 milliseconds
Build succeeded with warning. [20-04-16 02:24:02.684]Warning:MetadataCommand.ExtractMetadataError opening solution /Users/charlesw/Documents/dfxtest/docfx-seed/src/SampleClass1/SampleClass1.sln: Could not resolve type with token 010000ed from typeref (expected class ‘Microsoft.Build.Construction.SolutionFile’ in assembly ‘Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’). Ignored. [20-04-16 02:24:02.684]Warning:[MetadataCommand.ExtractMetadata]No metadata is generated for . [20-04-16 02:24:02.684]Warning:BuildCommand.BuildCore.Build Document.CompilePhaseHandlerWithIncremental.TocDocumentProcessor.Prebuild.BuildTocDocumentUnable to find either toc.yml or toc.md inside obj/api/. Make sure the file is included in config file docfx.json! 3 Warning(s) 0 Error(s) `
The full output from one of our projects:
` charleswMBP13TB:Samples charlesw$ mono …/…/docfx-2.52/docfx.exe docs/docfx_toc_enabled.json --serve [20-04-15 11:38:15.482]Info:[MetadataCommand.ExtractMetadata]Using mono /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/15.0/bin/MSBuild.dll as inner compiler. [20-04-15 11:38:15.784]Info:[MetadataCommand.ExtractMetadata]Loading projects… [20-04-15 11:38:16.702]Warning:MetadataCommand.ExtractMetadataError opening project /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: The type initializer for ‘Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer’ threw an exception… Ignored. [20-04-15 11:38:16.709]Info:[MetadataCommand]Completed Scope:MetadataCommand in 1291.8044 milliseconds. [20-04-15 11:38:16.709]Error:Error extracting metadata for /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00380] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x000c0] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 [20-04-15 11:38:16.709]Info:Completed in 1295.6479 milliseconds
Build failed. [20-04-15 11:38:16.713]Warning:MetadataCommand.ExtractMetadataError opening project /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: The type initializer for ‘Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer’ threw an exception… Ignored. [20-04-15 11:38:16.713]Error:Error extracting metadata for /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00380] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x000c0] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 1 Warning(s) 1 Error(s) charleswMBP13TB:Samples charlesw$ mono …/…/docfx-2.52/docfx.exe docs/docfx_toc_enabled.json [20-04-16 02:09:11.944]Info:[MetadataCommand.ExtractMetadata]Using mono /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/15.0/bin/MSBuild.dll as inner compiler. [20-04-16 02:09:12.360]Info:[MetadataCommand.ExtractMetadata]Loading projects… [20-04-16 02:09:13.441]Warning:MetadataCommand.ExtractMetadataError opening project /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: The type initializer for ‘Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer’ threw an exception… Ignored. [20-04-16 02:09:13.448]Info:[MetadataCommand]Completed Scope:MetadataCommand in 1583.7488 milliseconds. [20-04-16 02:09:13.448]Error:Error extracting metadata for /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00380] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x000c0] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 [20-04-16 02:09:13.448]Info:Completed in 1587.8387 milliseconds
Build failed. [20-04-16 02:09:13.451]Warning:MetadataCommand.ExtractMetadataError opening project /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: The type initializer for ‘Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer’ threw an exception… Ignored. [20-04-16 02:09:13.452]Error:Error extracting metadata for /Users/charlesw/Documents/dots/Samples/Unity.Entities.csproj: System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00380] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x000c0] in <36cbd452dc6f4b5d8daa3dce4c7355a8>:0 1 Warning(s) 1 Error(s)
`