.netstandard2.0 Project - DocFX MSBuild Error

I tried to generate documentation for a .netstandard2.0 project using DocFX.

  • Installed DocFX using chocolatey package.
  • Created a sample project using command line.
docfx init
  • Updated the docfx.json w.r.t the folder structure.
  • Build the website using command line.
docfx --serve

The DocFX site builded but project specific documentation not generated. And there were some warnings like

Warning:No metadata is generated for ProjectName

SDK "Microsoft.NET.Sdk" not found

Solution

Set environment variable MSBuildSDKsPath pointing right to the SDK path. In my case,

C:\Program Files\dotnet\sdk\2.1.500\Sdks

After setting the environment variable, closed the command line (VS Code) and re opened. Tried building the DocFX again and it worked.

Additional Resources


comments powered by Disqus

About the author

  • Abhith Rajan

    Abhith Rajan

    Abhith Rajan is a full-stack developer, consultant, Sysberries employee, and biker. Who passionate about C# and JavaScript. Works on his blog, his personal finance web app and its react native mobile app in his free time.

    Buy me a coffeeBuy me a coffee