web-configassembly-resolutionassembly-referencesmachine.config

Assembly redirect being ignored in machine.config. In web.config works


I have two versions of a dll. I am seeing a unexpected behaviour. When I add the assembly redirect to web.config it works , but when it is added at machine.config I get some errors inside my app caused by the loading of old version of the library. I dont get to undertsand why is that happening.

Whats going on???

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>

            <assemblyIdentity name="My.Library" publicKeyToken="..removed in stackoverflow...." culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>

Solution

  • <runtime/> was duplicated in machine.config. Be careful with that sice it does not throws exceptions.