0

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

Sam H
  • 91
  • 1
  • 9
  • https://github.com/docascode/docfx-seed Clearly they have a sample project showing how to get started on GitHub. – Lex Li Jun 10 '18 at 02:45
  • I will reread those instructions, but I believe that I set up my project correctly. There are a variety of ways to install and run docfx if my understanding is correct. I was attempting to use the version integrated into visual studios(#3 on https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html). I didn't ignore the instructions on how to get started. There is a problem with the my set-up somehow, possible my error or possibly a bug in docfx. – Sam H Jun 10 '18 at 03:41

1 Answers1

1

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"
}],
hvndev
  • 96
  • 1
  • 7
  • Since the metadata file generated by my installation of DocFX came without the cwd setting, I assume that you added it by hand. However it got there, I discovered that it's essential unless your source code is in a directory named /src, which would be nonstandard for a VB or C# project. – David A. Gray Sep 05 '18 at 02:12
  • this got me further but my TOC is empty, . api docs exist though. Any ideas? –  Jun 18 '21 at 05:44