Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I believe .net will search for the assemblies in the application bin directory like so: \bin\conflict.dll (6.2) \bin\5.8\conflict.dll (5.8)</p> </blockquote> <p>No, this is wrong. I would suggest you reading this article to learn more about what <a href="http://msdn.microsoft.com/en-us/library/yx7xezcf(v=VS.100).aspx" rel="nofollow noreferrer">heuristics does the CLR use for probing</a>. </p> <p>This being said, <strike>you cannot have two different versions of the same assembly loaded in the same application domain</strike> you can load different versions of the same assembly into the same application domain but it is <a href="http://msdn.microsoft.com/en-us/library/dd153782.aspx#avoid_loading_multiple_versions" rel="nofollow noreferrer">considered bad practice</a> and should be avoided. In your case this means that you will have to choose which version of the conflicting assembly you want to use. You have a couple of choices:</p> <ol> <li>Recompile <code>helper.dll</code> to use the latest version of <code>conflict.dll</code> (I will definetely go with this one if Ihave the source code for <code>helper.dll</code>).</li> <li><p>Choose which version of <code>conflict.dll</code> you want and apply a <a href="http://msdn.microsoft.com/en-us/library/7wd6ex19(v=VS.100).aspx" rel="nofollow noreferrer"><code>&lt;bindingRedirect&gt;</code></a> in your config file. For example if you want to use the latest version:</p> <pre><code>&lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="conflict" publicKeyToken="xxxxxxxxx" culture="neutral" /&gt; &lt;bindingRedirect oldVersion="5.8.0.0" newVersion="6.2.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; </code></pre></li> </ol> <p>This will effectively instruct the CLR to load version 6.2 of <code>conflict.dll</code> when it tries to resolve references for <code>helper.dll</code>. Note that if the two versions are strongly signed with different keys this technique won't work. Obviously as <code>helper.dll</code> has been compiled against version 5.8 if you have any differences (missing methods, different method signatures) you will get a runtime exception when trying to call a conflicting method so do this only if you are absolutely sure what you are doing.</p> <p>Conclusion: no matter which path you decide to take, you will have to <code>xcopy</code> in the <strong>bin</strong> folder a single version of the <code>conflict.dll</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload