dotnet / dotnet/docfx

Error:[MergeCommand]System.NullReferenceException: Object reference not set to an instance of an object.

Open
#7,106 2 comments 0 reactions 0 assignees View on GitHub
dotnet
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**Operating System**: Windows on github-actions

**DocFX Version Used**: docfx 2.56.6.0

**Template used**: https://github.com/steffen-wilke/darkfx, memberpage

**Steps to Reproduce**:

I'm trying to merge 2 projects into one website. I've searched the repo for the issues but I can't still find my answer to fix this problem.

~~~
{
"metadata": [
{
"src": [
{
"files": [
"source/scripting_v2/**.csproj"
],
"src": ".."
}
],
"dest": "scripting_v2"
},
{
"src": [
{
"files": [
"source/scripting_v3/**.csproj"
],
"src": ".."
}
],
"dest": "scripting_v3"
}
],
"merge": {
"content": [
{
"files": [
"scripting_v2/**.yml"
]
},
{
"files": [
"scripting_v3/**.yml"
]
}
],
"fileMetadata": {
"platform": {
"scripting_v2/*.yml": [
"net48"
],
"scripting_v3/*.yml": [
"net48"
]
}
}
},
"build": {
"content": [
{
"files": [
"scripting_v2/**.yml",
"scripting_v2/index.md"
]
},
{
"files": [
"scripting_v3/**.yml",
"scripting_v3/index.md"
]
},
{
"files": [
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"assets/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadata": {
"_appTitle": "Community Script Hook V .NET",
"_appFooter": "Unofficial SHV.NET Online Documentation By nitanmarcel - MIT",
"_disableContribution": true,
"_enableSearch": true,
"_appLogoPath": "-",
"_appFaviconPath": "assets/favicon.png"

},
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"template/darkfx",
"template/memberpage"
],
"postProcessors": ["ExtractSearchIndex"],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false

}
}
~~~
**Expected Behavior**: Website should be generated with 3 paths, `/index.html`, `/scripting_v2/index.html` , /scripting_v3/index.html

**Actual Behavior**: Crashes with error:

~~~
[21-02-26 06:37:11.525]Error:[MergeCommand]System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DocAsCode.Build.Engine.HostServiceCreator.LoadModels(IEnumerable`1 files, DocumentBuildParameters parameters, IDocumentProcessor processor)
at Microsoft.DocAsCode.Build.Engine.HostServiceCreator.CreateHostService(DocumentBuildParameters parameters, TemplateProcessor templateProcessor, IMarkdownService markdownService, IEnumerable`1 metadataValidator, IDocumentProcessor processor, IEnumerable`1 files)
at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.Build(IDocumentProcessor processor, DocumentBuildParameters parameters, IMarkdownService markdownService)
at Microsoft.DocAsCode.SubCommands.MetadataMerger.MergePageViewModel(MetadataMergeParameters parameters)
at Microsoft.DocAsCode.SubCommands.MetadataMerger.Merge(MetadataMergeParameters parameters)
at Microsoft.DocAsCode.SubCommands.MergeCommand.MergeDocument(String baseDirectory, String outputDirectory)
9488 Warning(s)
1 Error(s)
~~~

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.