-
Notifications
You must be signed in to change notification settings - Fork 881
Description
DocFX version: 2.70.3
Project built with .NET Core SDK 7.0.401 (also tried .NET 6.0, same behaviour)
Reproducing the issue:
- Follow the instructions in the Documentation.
- Copy the generated assembly to templates/my-template/plugins
- Build the site
Observed behavior:
- Exception message (see below), PostProcessor does not work
Expected behavior:
- PostProcessor is picked up as the documentation would suggest
Others seem to struggle with the issue as well:
- https://stackoverflow.com/questions/60062901/how-to-run-docfx-plugins-post-processors-under-docfx-console
- Same issue but marked as fixed: [BUG] Custom post processors are completely ignored by docfx #8740
Discussed in #9239
Originally posted by michfuchs September 25, 2023
One appraoch to solve #9238 seems to be implementing a custom PostProcessor, as described in the Documentation.
However, I don't seem to be able to load my post processor.
My docfx.json configuration for the post processors looks like this:
"postProcessors": [ "ExtractSearchIndex", "MyPostProcessor" ]
Since ExtractSearchIndex works, I'm confident it's in the right spot.
Step 4 in the documentation specifies where the built dll of the assembly containing the preprocessor should be copied to:

I tried several folder options, none seem to work:




I am consistently getting the following error:
1>Searching custom plugins in directory ****\802_Documentation\templates\my-template\plugins...
1>6 plug-in(s) loaded.
1>Post processor ExtractSearchIndex loaded.
1>EXEC : warning : Can't import: MyPostProcessor, System.Composition.Hosting.CompositionFailedException: No export was found for the contract 'IPostProcessor "MyPostProcessor"'.
1> at System.Composition.CompositionContext.GetExport(CompositionContract contract)
1> at System.Composition.CompositionContext.GetExport(Type exportType, String contractName)
1> at Docfx.Common.CompositionContainer.GetExport(CompositionHost container, Type type, String name) in /_/src/Docfx.Build.Engine/CompositionContainer.cs:line 41
1>EXEC : warning : Can't find the post processor: MyPostProcessor
It was always 6 plug-ins, even before I added the processor, so the plug-in is definitely not picked up.
