C#C
C#4y ago
n8ta

❔ Binding redirects not being loaded despite config file being set

I have net48 package with a binding redirect from newtonsoft 0->13 to 13.0.0.0
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  ...
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <!-- Use StarDefinitionsCanExceedAvailableSpace=true to avoid UI hangs on high-resolution monitors -->
    <AppContextSwitchOverrides value="Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true"/>
  </runtime>
  <userSettings>
  </userSettings>
</configuration>

This redirect is not being used at runtime and I can confirm that with fusion++
https://pastebin.com/NVw4wxsc

However if I debug and inspect what my config file path is
var configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; It is correct and when I open it I see my redirect.

How can I debug why my config file's binding redirect is not being parsed?

This only happens when run as a test not when we run the normal app.
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Was this page helpful?