-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't import: MyPostProcessor: No export was found for the contract 'IPostProcessor "MyPostProcessor"' #9246
Comments
Is there a DLL that contains |
A version mismatch was responsible for the issue (see answer in #9239). Maybe a warning could be shown if versions are not matched. Thanks for your help. |
Have you ever had a similar issues in docker containers ? On my windows machine, everything works perfectly, but inside a container based on warning: Can't import: TagsProcessor, System.Composition.Hosting.CompositionFailedException: No export was found for the contract 'IPostProcessor "TagsProcessor"'.
at System.Composition.CompositionContext.GetExport(CompositionContract contract)
at System.Composition.CompositionContext.GetExport(Type exportType, String contractName)
at Docfx.Common.CompositionContainer.GetExport(CompositionHost container, Type type, String name) in /_/src/Docfx.Build/CompositionContainer.cs:line 41
warning: Can't find the post processor: TagsProcessor It is exactly the same code, using Did anyone encounter the same issue ? If there is something to do for unix-based OS so that the |
@alricsans |
I compared the one that works with the one that does not (with the
Loading plug-ins and post-processors...
Searching custom plugins in directory C:\<project-path>\docs\<my-template>\plugins...
Scanning assembly file C:\<project-path>\docs\<my-template>\plugins\Docfx.TagsGenerator.PostProcessor.dll...
Post processor ExtractSearchIndex loaded.
Post processor TagsProcessor loaded.
Post processor SitemapGenerator loaded.
7 plug-in(s) loaded.
Loading plug-ins and post-processors...
warning: Can't import: TagsProcessor, System.Composition.Hosting.CompositionFailedException: No export was found for the contract 'IPostProcessor "TagsProcessor"'.
at System.Composition.CompositionContext.GetExport(CompositionContract contract)
at System.Composition.CompositionContext.GetExport(Type exportType, String contractName)
at Docfx.Common.CompositionContainer.GetExport(CompositionHost container, Type type, String name) in /_/src/Docfx.Build/CompositionContainer.cs:line 41
warning: Can't find the post processor: TagsProcessor
Post processor SitemapGenerator loaded. Unfortunately I don't see any differences in the first lines ( |
It seems that the DLL in the
Is it able to confirm I've also tried to run docfx on docker by using this Dockerfile
|
Thank you so much @filzrev your comment helped me troubleshoot my problem. What seemed to cause the problem was that the dll from my postprocessor were copied to : Many thanks again for your help @filzrev ! Edit : |
DocFX version: 2.70.3
Project built with .NET Core SDK 7.0.401 (also tried .NET 6.0, same behaviour)
Reproducing the issue:
Observed behavior:
Expected behavior:
Others seem to struggle with the issue as well:
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:
It was always 6 plug-ins, even before I added the processor, so the plug-in is definitely not picked up.
The text was updated successfully, but these errors were encountered: