简体   繁体   中英

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.

  • I am sure I am editing the correct machine.config since other changes on it take effect in the app.
  • I need the change to be inside machine.config since it´sa server with a lot of apps which need to have the redirection.

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM