Sam
Sam

Reputation: 105

Using docfx.console fails to generate documentation

I installed docfx.console through the nuget package manager (visual studios 2017 15.7.3) into a test project. My project is a .net library with a singular class with a bit of xml documentation. When I build the project it creates a _site file with a .html file but no documentation. It also generates an api, apidoc and articles folder and a docfx.json file.

The project throws the warning: Unable to find either toc.yml or toc.md inside obj/api/. Make sure the file is included in config file docfx.json!

I found a few similar issues in github which advised setting my visual studio version to 2015, however this solution doesn't appear to work with docfx.console as far as I can tell. Does anyone know how I might be able to correct this issue? Thank you

Upvotes: 0

Views: 3908

Answers (1)

hvndev
hvndev

Reputation: 106

I also stumbled upon this issue when I was documenting an existing VB.net solution. Without knowing what your docfx.json file looks like or whether your .NET library is written in C# or VB.net, I can only provide a answer that fixed my issue and maybe will help with yours.

For me when installing docfx via nuget, the docfx.json file is set to be used with C# projects and not VB.Net projects by default.

I easily fixed this by modifying the docfx.json file and changing the metadata file source extension to search for *.vbproj:

  "metadata": [
{
  "src": [
    {
      "files": [
        "*.vbproj"
      ],
      "cwd": ".",
      "exclude": [
        "**/obj/**",
        "**/bin/**",
        "_site/**"
      ]
    }
  ],
  "dest": "obj/api"
}],

Upvotes: 1

Related Questions