title: Disallow to use multiple versions of NuGet packages in solution
body: <p>We have a complex Visual Studio solution with projects referencing the same NuGet packages of different versions.</p>
  
  <p>I feel this is a bad practice, as potentially can lead to <em>dll hell</em></p>
  
  <p>So - is there a way to control this?</p>
  
  <p>Ideally it should be a part of either:</p>
  
  <ul>
  <li>solution build</li>
  <li>TFS gated check-in</li>
  <li>delivery pipeline in whatever CI\CD tool is used.</li>
  </ul>
  
  <p>I really liked <a href="http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference" rel="nofollow">Package Manager Console Powershell Reference</a>. But I couldn't find a way to use those cmdlets (Get-Package and Get-Project -All) in external Powershell script outside of VS.</p>
  
  <p>The simplest solution I see is to write a custom Powershell script, which reads <strong>.sln</strong> file, gets all the projects and for each of them reads <strong>packages.config</strong> and takes all nuget packages versions from there.</p>
  
  <p>Or ... use a VS <strong><a href="http://msdn.microsoft.com/en-GB/library/envdte.dte.aspx" rel="nofollow">DTE</a></strong> to simplify this job, but so far I didn't have an experience of using it.</p>
  
  <p>And then ... once we have this script - we can run it in CI.</p>
  
  <p>Is there a simpler \ more standard way of doing this?</p>