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

Quickstart - NuGet - docfx.console - API files not generated #6162

Closed
weirdyang opened this issue Jun 30, 2020 · 4 comments
Closed

Quickstart - NuGet - docfx.console - API files not generated #6162

weirdyang opened this issue Jun 30, 2020 · 4 comments

Comments

@weirdyang
Copy link

weirdyang commented Jun 30, 2020

Operating System: (Windows or Linux or MacOS)

Windows 10 VS2019
DocFX Version Used:
2.56
Template used: (default or statictoc or contain custom template)
default
Steps to Reproduce:

  1. install docfx.console nuget package
  2. Build the project
  3. No API files generated in the api folder, only the index and toc pages are there.

Expected Behavior:

Documentation for API to be generated.

This method worked before.

Actual Behavior:
No HTML files generated for API

[Failure] Msbuild failed when processing the file 'C:\Users\weiya\Downloads\CatFacts\CatFacts.Core\CatFacts.Core.csproj' with message: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found.

Manifest file path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml'

@GidanMX2
Copy link

I have the same issue:

I have downloaded the latest release of docfx (2.56.2) and I'm using Visual Studio Community 2019 version 16.7.4. When I try to run docfx docfx.json --serve I get a log entry that says:

Info:[MetadataCommand.ExtractMetadata]Using msbuild C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin as inner compiler.

As you can see, docfx is using the MSBuild from an old VS 2017 installation (which actually should be uninstalled but appears that some files remain...). This cause other error like "unable to find DLL of SDK resolver" that block the metadata generation.

@qubitz
Copy link

qubitz commented Oct 5, 2020

This is clearly linked to #6135, but a manual script shouldn't be required. Any ideas on why these obsolete file paths are being chosen?

Choosen SDK resolver path:

 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\NuGet\Microsoft.Build.NuGetSdkResolver.dll

Desired SDK resolver path:

C:\Program Files (x86)\dotnet\sdk\3.1.301\Microsoft.Build.NuGetSdkResolver.dll

@qubitz
Copy link

qubitz commented Oct 13, 2020

After some digging, here's what I found:

TL;DR

Visual Studio installation required (read below).
MsBuildLocator can be silly, setting explicit environment variables may help.

More details

DocFx uses MsBuildLocator to find installed msbuild instances, which in turn use their respective NuGetSdkResolvers (the thing that is missing) so my conclusion was that the wrong msbuild instance was being found. Reasons:

@tbolon
Copy link
Contributor

tbolon commented Feb 25, 2021

Thank you. The solution for me was simply to uninstall VS Buid Tools 2017, because docfx was still trying to use MSBuild from VS 2017.

Thanks for the excellent investigation. Sad to see that MSBuildLocator is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants