title: Can't load file or assembly X when switching computers
body: <p>I'm using Xamarin.Studio on 2 machines Windows and Mac.</p>
  
  <p>I keep getting these annoying random errors every time I make a change on one platform then switch to working on the other platform. That is, I have a PC running Windows where I do some development then sometimes I develop on my Mac. I use Git.</p>
  
  <p>I have two projects. A library project and a unit test project. These are the current dependencies:</p>
  
  <p>Library project:</p>
  
  <pre><code>  &lt;package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10" /&gt;
    &lt;package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10" /&gt;
    &lt;package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10" /&gt;
    &lt;package id="Microsoft.Net.Http" version="2.2.29" targetFramework="portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10" /&gt;
    &lt;package id="Newtonsoft.Json" version="7.0.1" targetFramework="portable-net45+win+wpa81+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" /&gt;
  </code></pre>
  
  <p>Testing project:</p>
  
  <pre><code>  &lt;package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" /&gt;
    &lt;package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" /&gt;
    &lt;package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" /&gt;
    &lt;package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" /&gt;
    &lt;package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /&gt;
    &lt;package id="NUnit" version="2.6.3" targetFramework="net45" /&gt;
  </code></pre>
  
  <p>The first problem I had was when I switched from Mac to Windows and the tests wouldn't run. I finally realise that I had to:</p>
  
  <ul>
  <li>Reinstall Json package in the library project</li>
  <li>Add 5 packages to the test porject (the first 5 in the previous list)</li>
  <li><p>Add a redirection in app.config to both projects for Json:</p>
  
  <pre><code>&lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
    &lt;dependentAssembly&gt;
      &lt;assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /&gt;
      &lt;bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /&gt;
    &lt;/dependentAssembly&gt;
  &lt;/assemblyBinding&gt;
  </code></pre></li>
  </ul>
  
  <p>Keep in mind that this problem didn't surface until I switched to Windows.. it was compiling and running just fine on Mac.</p>
  
  <p>Now, I switched back to my Mac, and yet again another random bizarre problem..</p>
  
  <pre><code>SetUp : System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
  </code></pre>
  
  <p>I just can't figure out why on earth do these problems only happen when I switch to another PC. This has to be some problem with the cache system of botch .Net and Mono</p>
  
  <p>My question is:</p>
  
  <ul>
  <li>How to avoid this type of problem (clean cache?)</li>
  <li>How to fix this particular error?</li>
  </ul>