title: The assembly mscorlib.dll was not found or could not be loaded
body: <p>Firstly, I've seen <a href="https://stackoverflow.com/questions/10490155/unable-to-run-net-app-with-mono-mscorlib-dll-not-found-version-mismatch">this question</a>, and while the problem seems similar, it is not the same.</p>
  
  <p>I'm running a trimmed down mono, built without the 4.5 profile using <code>./configure --with-profile4=yes --with-profile4_5=no</code>.</p>
  
  <p>I have an application that targets .NET 4.0, built using mono's <code>xbuild</code>. When I run it against my trimmed down mono installation, I get this error:</p>
  
  <p><code>
  The assembly mscorlib.dll was not found or could not be loaded.
  It should have been installed in the `/opt/my-app/mono/lib/mono/4.5/mscorlib.dll' directory.
  </code></p>
  
  <p>Now, I'm not referencing only 4.0 assemblies - nothing from 4.5, AFAICS.</p>
  
  <p>Why might I be getting this error? </p>
  
  <p>I'm not sure if it's related, but I get this warning when building with <code>xbuild</code> (but not when building with <code>msbuild</code>, although I still get the <code>mscorlib.dll</code> when running against my trimmed down mono):</p>
  
  <pre><code>warning CS1685: The predefined type `System.Runtime.CompilerServices.ExtensionAttribute' is defined multiple times.
  Using definition from `mscorlib.dll' 
  </code></pre>
  
  <p>I'm also not sure if this is relevant either, but the build machine does has .NET 4.5 installed.</p>