0

I tried several times to build a documentation site with DocFx. Every time I run docfx metadata and docfx build, the process runs without any errors, but DocFx lists just a few types and member of my project.

I tried with several DocFx versions; currently I am using version 2.58.9.0.

File Structure:

File Structure

I already tried using "**.cs" instead of "**.csproj", with the same results.

My docfx.json:

{
    "metadata": [
    {
      "src": [
        {
          "files": [ "**.csproj" ],
          "cwd": "../Bugtracker" 
        }
      ],
      "dest": "api",
      "disableGitFeatures": false,
      "disableDefaultFilter": false
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "api/**.yml",
          "api/index.md"
        ]
      },
      {
        "files": [
          "articles/**.md",
          "articles/**/toc.yml",
          "toc.yml",
          "*.md"
        ]
      }
    ],
    "resource": [
      {
        "files": [
          "images/**"
        ]
      }
    ],
    "overwrite": [
      {
        "files": [
          "apidoc/**.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "dest": "_site",
    "globalMetadataFiles": [],
    "fileMetadataFiles": [],
    "template": [
      "default"
    ],
    "postProcessors": [],
    "markdownEngineName": "markdig",
    "noLangKeyword": false,
    "keepFileLink": false,
    "cleanupCacheHistory": false,
    "disableGitFeatures": false
  }
}

The documentation / api page looks as following:

api-page

But my project solution contains a lot more types and members, a lot of which include XML comments; see screenshot of solution files, classes.

My project settings are the following:

project settings

When I change the Framework to .NET Core 3.0, I get the following warnings for exactly the files which are shown in the DocFx docs—but, oddly, I get no warnings for other files in the solution:

visual studio warnings

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • Dominik, I assume you've already accounted for this, but just to be safe: Can you confirm that your types are `public`, not marked as `[Obsolete]`, and are not using C# 9.0 `record` types? Those are all factors that can result in types and members being excluded from your documentation. In particular, I could imagine your command objects potentially being records. – Jeremy Caney Jan 06 '22 at 19:42
  • I'd consider (temporarily) toggling the setting for `disableDefaultFilter`. There are a number of filters that are enabled by default which could affect this. If your types and members show up with that disabled, that isolate the problem. Additionally, you might try pointing directly to your compiled assemblies (`*.dll`), instead of your project files (`*.csproj`) to see if it's able to infer the compiled types. Finally, it would be useful to include the _signature_ (but not the method bodies) of one of your types that isn't showing up here so we can see what might be getting filtered. – Jeremy Caney Jan 06 '22 at 19:52
  • 1
    @JeremyCaney Sorry for the late response. After disabling the default filter I was getting a lot more results. I forgot to mention that I also want to enable documentation for private Types too (because this was specified in the requirements for this project I am working on) and didn't think about the default behavior... I will be looking into filters. – Dominik Beyerle May 17 '22 at 06:27

0 Answers0