Skip to content
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

Missing Binding Redirect in MemberPage Plugin #8205

Closed
zpqrtbnk opened this issue Oct 5, 2022 · 3 comments
Closed

Missing Binding Redirect in MemberPage Plugin #8205

zpqrtbnk opened this issue Oct 5, 2022 · 3 comments
Labels
dotnet Generate .NET API reference docs

Comments

@zpqrtbnk
Copy link

zpqrtbnk commented Oct 5, 2022

Operating System: Windows 10

DocFX Version Used: 2.59.4

Template used: default

Steps to Reproduce:

  1. add the MemberPage 2.59.4 plugin
  2. build doc

Expected Behavior: works (worked with previous versions)

Actual Behavior: fails, Fusion / binding error for System.Memory, Version=4.0.1.1

Analysis:

No idea how DocFX loads plugins, but looking at the Fusion logs, I see that

  • the docfx.exe executable loads System.Memory v 4.0.1.2 from its own directoy, trusting docfx.exe.config binding redirects
  • the MemberPage plugin tries to load System.Memory v 4.0.1.1 using a docfx.console\2.59.4\tools\plugins_b0lynfaw.gys\plugins\docfx.plugins.config config file and not docfx.exe own binding redirects. So I assume it's using the docfx.plugins.config file that comes with the plugin.

Patching memberpage/2.59.4/content/plugins/docfx.plugins.config to add the System.Memory binding redirect, and then it works.

Methink that the docfx.plugins.config file that ships with the plugin is missing that binding redirect.

See also: #7832

@tom-weiland
Copy link

I too have this problem, and as a result I'm now using v2.59.0 of DocFX and MemberPage which works properly.

What does this "binding redirect" actually look like in the file if I wanted to use it as a workaround?

@ThadT
Copy link

ThadT commented Oct 18, 2022

@tom-weiland
I just copied the setting that was in docfx.exe.config. Here's my docfx.plugins.config, which now allows me to build successfully.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
    </assemblyBinding>	
  </runtime>
</configuration>

@yufeih yufeih added the dotnet Generate .NET API reference docs label Dec 15, 2022
@yufeih
Copy link
Contributor

yufeih commented Jan 30, 2023

This is resolved in the latest version with a new library based plugin model, see this sample on using the member page plugin with the new approach.

@yufeih yufeih closed this as completed Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

4 participants