Describe the bug
On local docfx build.
docfx plugin DLL fails to load because of Docfx.Plugins version mismatch.
To Reproduce
Steps to reproduce the behavior:
Create custom PostProcessor DLL.
Place plugin DLL to samples\seed\template\plugins
Configure custom PostProcessor name at docfx.json's postProcessors section.
Start docfx build inside Visual Studio
Confirm following exception occurred.
System.Reflection.ReflectionTypeLoadException
HResult=0x80131602
Message=Unable to load one or more of the requested types.
Could not load file or assembly 'Docfx.Plugins, Version=2.76.0.0, Culture=neutral, PublicKeyToken=null'.
Source=System.Private.CoreLib
StackTrace:
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at Docfx.DocumentBuilderWrapper.<LoadPluginAssemblies>d__2.MoveNext() in C:\Projects\docfx\src\Docfx.App\Helpers\DocumentBuilderWrapper.cs:line 88
Expected behavior
It can load custom plugin DLL. on local build environment.
Root cause of problem
When docfx is build on local environment. assembly Version is set to 1.0.0
docfx load Docfx.Plugins, Version=1.0.0 on startup.
MEF(System.Composition) plugin try to load plugin DLL.
But it fails because it attempt to load newer dependent assembly (Docfx.Plugins, Version=2.76.0.0)
How to fix problems
It can successfully load plugin DLLs.
When manually assign newer version by Directory.Build.props (e.g. <Version>2.76.1</Version>)
So I thought either of the following actions will be required to fix versioning problems.
1, Manually update <Version> tags when docfx version is updated.
Describe the bug On local docfx build. docfx plugin DLL fails to load because of
Docfx.Plugins
version mismatch.To Reproduce Steps to reproduce the behavior:
samples\seed\template\plugins
PostProcessor
name atdocfx.json
'spostProcessors
section.docfx build
inside Visual StudioExpected behavior It can load custom plugin DLL. on local build environment.
Root cause of problem
Version
is set to1.0.0
Docfx.Plugins, Version=1.0.0
on startup.System.Composition
) plugin try to load plugin DLL.But it fails because it attempt to load newer dependent assembly (
Docfx.Plugins, Version=2.76.0.0
)How to fix problems It can successfully load plugin DLLs. When manually assign newer version by
Directory.Build.props
(e.g.<Version>2.76.1</Version>
)So I thought either of the following actions will be required to fix versioning problems. 1, Manually update
<Version>
tags when docfx version is updated.Context (please complete the following information):
Additional context Add any other context about the problem here.