Assembly dependency problems in a Xamarin.iOS project

Sep 9, 2014 at 8:03 PM
Hey Joe, first, thanks for LinqToTwitter -- it's great!

I'm using Xamarin + Xamarin.Forms, and I'm using the appropriate (and latest) version of LinqToTwitter in each of my platform-specific projects (WinPhone, Android, and iOS). On the iOS version, and only when I try to deploy to device (deploying to emulator is OK), I'm getting some dependency errors.
Error   1   MT3005:The dependency 'System.Threading.Tasks, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of the assembly 'LinqToTwitterPcl, Version=, Culture=neutral, PublicKeyToken=957107be965c25d9' was not found. Please review the project's references.

Error   2   MT3005:The dependency 'System.IO.Compression, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'LinqToTwitterPcl, Version=, Culture=neutral, PublicKeyToken=957107be965c25d9' was not found. Please review the project's references.

Error   3   MT3006:Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details.

Warning 4   The 'configuration' element is not declared.    C:\!Temp\Xamarin\ANFact2\ANFact2\ANFact2.iOS\app.config 2   2   ANFact2.iOS
Prior to this, back when testing only on emulator, I added some bindingRedirects to the iOS project's app.config to get rid of some warnings, but whatever I did there isn't helping here.

This assembly dependency stuff is pretty new to me, so I'm a bit lost. If you're able to help directly, or to redirect me to a relevant resource, I'd really appreciate it. Thanks!
Sep 9, 2014 at 9:01 PM

I don't have a lot of experience on the iOS deployment side yet, but maybe a couple tips might help. There are a couple strategies to resolve this: 1) remove any assembly references you don't need, and 2) ensure the assemblies that you do need deploy with the application. Look at any warnings in the IDE when you build to see if they indicate a problem. Also, if you need to deploy an assembly, it helps copy local. e.g. in VS you can right-click on reference, select properties, and set the copy property to local.

Sep 10, 2014 at 8:57 PM
Thanks for the reply, Joe. After digging into this a bit further I think I have an idea of what's going on. LinqToTwitter is dependent on Microsoft.BCL. Some of the components normally referenced in Microsoft.BCL (like System.IO & System.Threading.Tasks) either aren't available in Xamarin.iOS and Xamarin.Android projects, or non-standard versions of these components are available instead.

If a given project is compiled as an Xamarin.iOS or Xamarin.Android class library, then those BCL references would be updated or removed to reflect the available components in Xamarin.iOS or Xamarin.Android, respectively, and the resulting DLL wouldn't refer to these offending items. (See,

From loading up your project, it looks like the LinqToTwitter dll is not compiled as those Xamarin class library types, and so this problem remains. For whatever reason, this causes only warnings when running on iOS emulator, but causes errors when deployed to iOS device. I haven't tried to deploy to Android device yet (only emulator, which works fine other than some Output strings describing dependency problems), but I wouldn't be surprised if that fails as well.

I could be wrong on my diagnosis here -- this is just my best understanding given what I've read! Either way, I'd be glad to get your feedback to see what you think. Cheers!
Sep 11, 2014 at 11:49 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 11, 2014 at 11:54 PM
I haven't had any problem deploying to Android devices. I copied this to a work-item and will look at it closer.
Sep 12, 2014 at 3:15 PM
Here's a status update. In short, I got it to deploy on iOS without giving these errors. I was initiating the deployment from Visual Studio on my PC, and unbeknownst to me, my Mac's provisioning profile wasn't correctly being shared with VS. For whatever reason, this provisioning profile issue contributed to those dependency issues becoming errors, and those errors fired early enough and stopped the process that it never gave a notice about the provisioning profile being a problem (fun, right?). I noticed the provisioning profile issue in a different project, fixed it, tried my LinqToTwitter-using project again, and bingo -- errors gone.

This all said, I do still get a couple warnings...
Warning 1   Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see
Warning 2   Assuming assembly reference 'System.Net.Http.Primitives, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'System.Net.Http.Primitives, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy c:\!Temp\Xamarin\ANFact2\packages\linqtotwitter.3.0.4\lib\portable-win8+net45+wp8\LinqToTwitterPcl.dll
Warning #1 I can get rid of with by adding BindingRedirects to the app.config file, but warning #2 I can't find a way to remove. I'm guessing both of these are related to the not building as a Xamarin.iOS class library as mentioned above, but since these are warnings and not errors, not as big of a deal anymore.

So, while the urgency is gone, I wanted to share as much as I could in case you wanted to still dig into this in the future. Either way, thanks for the library and your assistance here. Cheers!
Marked as answer by JoeMayo on 9/12/2014 at 10:53 AM
Sep 12, 2014 at 5:31 PM
Thank you for the follow-up.