title: Xamarin iOS - Could not load file or assembly 'System.Threading.Tasks' at startup
body: <p>I just upgraded to Xamarin studio 5.9 (build 431), and cannot run my project anymore. It works with a clean project though.</p>
  
  <p>When I run my app, I don't even land in Main. </p>
  
  <p>The Application Output in Xamarin studio prints a bunch of assembly loadings. It gets to <code>MobileClientiOS.app/Newtonsoft.Json.dll [External]</code>, then it crashes with the following output:</p>
  
  <blockquote>
    <p>Could not load file or assembly 'System.Threading.Tasks' or one of its
    dependencies. The system cannot find the file specified.
    (System.IO.FileNotFoundException)   at System.AppDomain.Load
    (System.Reflection.AssemblyName assemblyRef,
    System.Security.Policy.Evidence assemblySecurity) [0x00081] in
    .../mono/mcs/class/corlib/System/AppDomain.cs:706 at
    System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef)
    [0x00000] in .../mono/mcs/class/corlib/System/AppDomain.cs:674 at
    System.Reflection.Assembly.Load (System.Reflection.AssemblyName
    assemblyRef) [0x00000] in
    .../mono/mcs/class/corlib/System.Reflection/Assembly.cs:551 at
    ObjCRuntime.Runtime.CollectReferencedAssemblies
    (System.Collections.Generic.List 1 assemblies,
    System.Reflection.Assembly assembly) [0x00019] in
    .../maccore/src/ObjCRuntime/Runtime.cs:218 at
    ObjCRuntime.Runtime.CollectReferencedAssemblies
    (System.Collections.Generic.List 1 assemblies,
    System.Reflection.Assembly assembly) [0x0002c] in
    .../maccore/src/ObjCRuntime/Runtime.cs:220 at
    ObjCRuntime.Runtime.CollectReferencedAssemblies
    (System.Collections.Generic.List 1 assemblies,
    System.Reflection.Assembly assembly) [0x0002c] in
    .../maccore/src/ObjCRuntime/Runtime.cs:220 at
    ObjCRuntime.Runtime.RegisterEntryAssembly (System.Reflection.Assembly
    entry_assembly) [0x0001b] in
    .../maccore/src/ObjCRuntime/Runtime.cs:200 at
    ObjCRuntime.Runtime.RegisterEntryAssembly (IntPtr a) [0x00000] in
    .../maccore/src/ObjCRuntime/Runtime.cs:158 at
    ObjCRuntime.Runtime.register_entry_assembly (IntPtr assembly)
    [0x00000] in .../maccore/runtime/Delegates.generated.cs:118 at
    (wrapper native-to-managed)
    ObjCRuntime.Runtime:register_entry_assembly (intptr) 2015-05-04</p>
    
    <p>MobileClientiOS[77830:1943120] critical:  Got a SIGABRT while
    executing native code. This usually indicates a fatal error in the
    mono runtime or one of the native libraries  used by your application.</p>
  </blockquote>
  
  <p>Sorry for the long stacktrace, but I'm out of ideas. We are using PCL's, but there haven't been a problem before this Xamarin Studio-upgrade.</p>
  
  <p>Thank you!</p>
  
  <hr>
  
  <p>Edit:
  I downgraded Xamarin.iOS and it's working again. The assembly it seems to fail on is (which now works with the old version):</p>
  
  <blockquote>
    <p>/MobileClientiOS.app/System.Xml.Linq.dll [External]</p>
  </blockquote>
  
  <p>How to be able to run with the latest version? I do not know.</p>