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

Using "developer command prompt" coerces NRE from docfx #5161

Closed
dovholuknf opened this issue Oct 2, 2019 · 1 comment
Closed

Using "developer command prompt" coerces NRE from docfx #5161

dovholuknf opened this issue Oct 2, 2019 · 1 comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs

Comments

@dovholuknf
Copy link

dovholuknf commented Oct 2, 2019

Operation System: Windows 10

DocFX Version Used: 2.45.1.0

Template used: the walkthrough - https://dotnet.github.io/docfx/tutorial/walkthrough/artifacts/walkthrough2.zip

Steps to Reproduce:

  1. download and unzip https://dotnet.github.io/docfx/tutorial/walkthrough/artifacts/walkthrough2.zip to c:\temp\docfx
  2. cd to C:\temp\docfx\walkthrough2
  3. run docfx (inside a "Developer Command Prompt for VS 2017" OR "Developer Command Prompt for VS 2019")

Expected Behavior:
It should work

Actual Behavior:
Fails:

C:\temp\docfx\walkthrough2>docfx
[19-10-02 04:37:15.229]Info:Config file docfx.json found, start generating metadata...
[19-10-02 04:37:15.348]Info:[MetadataCommand.ExtractMetadata]Environment variable VSINSTALLDIR is set to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\, it is used as the inner compiler.
[19-10-02 04:37:15.537]Info:[MetadataCommand.ExtractMetadata]Loading projects...
[19-10-02 04:37:15.957]Warning:[MetadataCommand.ExtractMetadata](C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj)Error opening project C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.. Ignored.
[19-10-02 04:37:15.972]Info:[MetadataCommand]Completed Scope:MetadataCommand in 629.3258 milliseconds.
[19-10-02 04:37:15.973]Error:Error extracting metadata for C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.<SaveAllMembersFromCacheAsync>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.<ExtractMetadataAsync>d__11.MoveNext()
[19-10-02 04:37:15.975]Info:Completed in 636.251 milliseconds


Build failed.
[19-10-02 04:37:15.982]Warning:[MetadataCommand.ExtractMetadata](C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj)Error opening project C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.. Ignored.
[19-10-02 04:37:15.985]Error:Error extracting metadata for C:/temp/docfx/walkthrough2/src/HelloDocfx1/HelloDocfx1.csproj: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.<SaveAllMembersFromCacheAsync>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.<ExtractMetadataAsync>d__11.MoveNext()
        1 Warning(s)
        1 Error(s)

Additional Comment
Also note that if you do this using a 'plain' command prompt docfx will succeed. Something must be on the path that's causing trouble

@superyyrrzz superyyrrzz added dotnet Generate .NET API reference docs bug A bug to fix labels Oct 9, 2019
@superyyrrzz
Copy link
Contributor

Root cause should be #4782 . Close and keep track there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

2 participants