Skip to content

NullReferenceException crashing docfx build on Azure DevOps #7101

Closed

Description

Operating System: Windows

DocFX Version Used: 2.56.6

Template used: default

Expected Behavior:

No errors.

Actual Behavior:

A bunch of LoaderExceptions and then a NullReferenceException.

[21-02-26 05:24:16.951]Warning:MetadataCommand.ExtractMetadataError opening project C:/vsts-agent-win-x64-2.172.2/_work/19/s/Project.csproj: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.. Ignored.

[21-02-26 05:24:16.951]Error:Error extracting metadata for C:/vsts-agent-win-x64-2.172.2/_work/19/s/Project.csproj: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.d__11.MoveNext()

Analysis:

I did a bunch of digging on this and tried what was suggested on #4869 & #4782, but I think this is something different. With verbose logging turned on:

[21-02-26 05:24:15.831]Info:[MetadataCommand.ExtractMetadata]Using msbuild C:\Program Files (x86)\Microsoft Visual Studio\2019\ TestAgent \MSBuild\Current\Bin as inner compiler.

Notice the highlight there, the test version of VS is being selected.

It looks like this was a bug fixed in MSBuildLocator: microsoft/MSBuildLocator#73

A possible fix is to update the dependency docfx has to >=1.3.2?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    dotnetGenerate .NET API reference docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions