Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Editor not picking up app.config bindingredirect for assemblies.

Discussion in 'Editor & General Support' started by akshays, Oct 9, 2020.

  1. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    I have the following in my app.config ::
    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <configuration>
    3.   <runtime>
    4.     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    5.       <dependentAssembly>
    6.         <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    7.         <bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
    8.       </dependentAssembly>
    9.       <dependentAssembly>
    10.         <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    11.         <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
    12.       </dependentAssembly>
    13.       <dependentAssembly>
    14.         <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    15.         <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
    16.       </dependentAssembly>
    17.       <dependentAssembly>
    18.         <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    19.         <bindingRedirect oldVersion="4.0.2.0" newVersion="4.0.3.0" />
    20.       </dependentAssembly>
    21.     </assemblyBinding>
    22.   </runtime>
    23. </configuration>
    24.  
    When I build and run with "Development Build" and "Script Debugging" checkboxes checked then I get no errors. I assume it is picking this up at runtime from app.config.

    When I run in editor I get the following errors:

    Code (CSharp):
    1. Assembly '<dll path and name>' will not be loaded due to errors: '<dll name>' references strong named System.Buffers in a different folder, versions has to match. Assembly references: 4.0.2.0 Found in project: 4.0.3.0.
    2.  
    Code (CSharp):
    1. Assembly '<dll path and name>' will not be loaded due to errors:
    2. System.Threading.Tasks.Extensions references strong named System.Runtime.CompilerServices.Unsafe in a different folder, versions has to match. Assembly references: 4.0.4.1 Found in project: 4.0.6.0.
    3.  
    Looks like the editor is ignoring the app.config assembly/dll bindingredicts.

    Please advice. Thanks in advance.
     
  2. PascalZieglerAzuryLiving

    PascalZieglerAzuryLiving

    Joined:
    Aug 3, 2020
    Posts:
    11
    I got the same issue. Did you solve this?