Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException crashing docfx build on Azure DevOps #7101

Closed
CodeBlanch opened this issue Feb 26, 2021 · 1 comment
Closed

NullReferenceException crashing docfx build on Azure DevOps #7101

CodeBlanch opened this issue Feb 26, 2021 · 1 comment
Labels
dotnet Generate .NET API reference docs

Comments

@CodeBlanch
Copy link

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?

@yufeih yufeih added the dotnet Generate .NET API reference docs label Dec 15, 2022
@filzrev
Copy link
Contributor

filzrev commented Nov 16, 2023

I thought this issue can be closed by following reasons

  • docfx v2.59.4 is using bug fixed version (MSBuildLocator 1.41)
  • Recent version of docfx has no VS instance dependencies

@yufeih yufeih closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

3 participants