简体   繁体   English

C# 生成。XML 文件不包括其他文件 class

[英]C# generated .XML file not including other file class

I am writing a C# winforms application, and I would like to create documentation for my code with XML comments.我正在编写 C# winforms 应用程序,我想为我的代码创建文档,其中包含 XML 注释。 However, it seems like I am doing something wrong and can't figure out what is it.但是,似乎我做错了什么,无法弄清楚它是什么。 Currently, for generating HTML documentation I am using DocFX (but i also tried sandcastle , but with the same result).目前,为了生成 HTML 文档,我正在使用DocFX (但我也尝试过sandcastle ,但结果相同)。 When XML File and HTML documentation is created, it seems to only consists of my main Form1.cs class(which is interesting because in that particular file I dont have any XML comments).当创建 XML 文件和 HTML 文档时,它似乎只包含我的主要Form1.cs类(这很有趣,因为在那个特定文件中我没有任何 XML 评论)。 Other .cs files(which consist of XML comments) are not included (they were added to the project throughout development via visual studio with right-click on project -> Add -> New item -> C# class).不包括其他.cs文件(由 XML 注释组成)(它们在整个开发过程中通过 Visual Studio 添加到项目中,右键单击项目 -> 添加 -> 新项目 -> C# 类)。 Here is my docfx.json :这是我的docfx.json

{
  "metadata": [
    {
      "src": [
        {
          "files": [
            "*.cs"
          ],
          "cwd": ".",
          "exclude": [
            "**/obj/**",
            "**/bin/**",
            "_site/**"
          ]
        }
      ],
      "dest": "obj/api"
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "api/**.yml"
        ],
        "cwd": "obj"
      },
      {
        "files": [
          "api/*.md",
          "articles/**.md",
          "toc.yml",
          "*.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "resource": [
      {
        "files": [
          "images/**"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "overwrite": [
      {
        "files": [
          "apidoc/**.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "dest": "_site",
    "template": [
      "default"
    ]
  }
}

And also, my files hierarchy looks like this:而且,我的文件层次结构如下所示: 文件层次结构

How do I include other files in XML creation as well?如何在 XML 创建中包含其他文件?

Could the reason be that the classes for which the documentation is not generated are internal classes?原因可能是没有为其生成文档的类是内部类吗? I believe that documentation is generated only for public classes by default.我相信默认情况下仅为公共类生成文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM