title: How to resolve NuGet dependency hell
body: <p>I develop a library with some functional named <code>CompanyName.SDK</code> which must be integrated in company project <code>CompanyName.SomeSolution</code></p>
  
  <p><code>CompanyName.SDK.dll</code> must be deployed via NuGet package.
  And <code>CompanyName.SDK</code> package has a dependency on 3rd party NuGet packages. For good example, let's take <a href="https://www.nuget.org/packages/Unity" rel="noreferrer"><code>Unity</code></a>. Current dependency is on <code>v3.5.1405-prerelease</code> of <code>Unity</code>.</p>
  
  <p><code>CompanyName.SomeSolution.Project1</code> depends on <code>Unity</code> <code>v2.1.505.2</code>.
  <code>CompanyName.SomeSolution.Project2</code> depends on <code>Unity</code> <code>v3.0.1304.1</code>.</p>
  
  <p>Integrating <code>CompanyName.SDK</code> into this solution adds dependency on <code>Unity</code> <code>v3.5.1405-prerelease</code>.
  Let's take that <code>CompanyName.SomeSolution</code> has one runnable output project <code>CompanyName.SomeSolution.Application</code> that depends on two above and on <code>CompanyName.SDK</code></p>
  
  <p>And here problems begin. All <code>Unity</code> assemblies has equal names in all packages without version specifier. And in the target folder it will be only one version of <code>Unity</code> assemblies: <code>v3.5.1405-prerelease</code> via <code>bindingRedirect</code> in <code>app.config</code>.</p>
  
  <p><strong>How can code in <code>Project1</code>, <code>Project2</code> and <code>SDK</code> use exactly needed versions of dependent packages they were coded, compiled and tested with?</strong></p>
  
  <p><em>NOTE1:</em> <code>Unity</code> is just an example, real situation is 10 times worse with 3rdparty modules dependent on another 3rdparty modules which in turn has 3-4 versions simultaneously.</p>
  
  <p><em>NOTE2:</em> I cannot upgrade all packages to their latest versions because there are packages that have dependency not-on-latest-version of another packages.</p>
  
  <p><em>NOTE3:</em> Suppose dependent packages has breaking changes between versions. It is the real problem why I'm asking this question.</p>
  
  <p><em>NOTE4:</em> I know about question <a href="https://stackoverflow.com/questions/17806/warning-found-conflicts-between-different-versions-of-the-same-dependent-assemb">about conflicts between different versions of the same dependent assembly</a> but answers there does not solve the root of a problem - they just hide it.</p>
  
  <p><em>NOTE5:</em> Where the hell is that promised "DLL Hell" problem solution? It is just reappearing from another position.</p>
  
  <p><em>NOTE6:</em> If you think that using GAC is somehow an option then write step-by-step guide please or give me some link.</p>