尽管阅读了docfx 文档和许多 Github 问题,但我无法让我的 docfx 项目正常工作。
采取的步骤:
- 初始化根目录
docfx init -q
- 从根目录构建
docfx build
(没有错误) - 服务
docfx "/user/docfx_project/docfx.json" --serve
堆栈跟踪:
Error:Error extracting metadata for /user/docfx_project/src/MyApp/MyApp.csproj,/user/docfx_project/src/MyApp.Tests/MyApp.Tests.csproj: System.NullReferenceException: Object reference not set to an instance of an object
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.SaveAllMembersFromCacheAsync () [0x00380] in <0779a76130d64c11baa2c8c084cbfe7c>:0
at Microsoft.DocAsCode.Metadata.ManagedReference.ExtractMetadataWorker.ExtractMetadataAsync () [0x000c0] in <0779a76130d64c11baa2c8c084cbfe7c>:0
环境:
- OSX 10.13.6
- 文档 2.56.2.0
- .NET Core SDK (3.1.401)
- Mono JIT 编译器版本 6.10.0.104
项目结构:
docfx-project
|
+-- _site
+-- api
+-- apidoc
+-- articles
+-- docfx.json
+-- images
+-- index.md
+-- obj
+-- src
|
+-- MyApp
|
+-- MyApp.csproj
+-- toc.yml
docfx.json:
{
"metadata": [
{
"src": [
{
"files": [
"src/**/**.csproj"
]
}
],
"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
}
}
哈尔普。