Referencing PCL project for 4.5 requires Business Edition in Android but not in iOS

SebastienClementSebastienClement USMember
edited December 2013 in Cross Platform with Xamarin

I am using XS 4.2.1 w/ Xamarin iOS 7.0.4.209 and Xamarin Android 4.10.1

I am including a reference to Newtonsoft.json.dll compiled against PCL 4.5 profile 78

The build works fine for my iOS project.

The build of my Android project fails saying that a library references System.ServiceModel which requires the business edition.

I can replicate the same behavior when creating a test library with a single class, build it against the 4.5 PCL, and referencing it inside a simple Android and a simple iOS projects. The iOS project builds fine, the Android project will not build without a Business license.

Why is there a difference between the platforms? System.ServiceModel is part of the PCL subset, so I cannot remove the reference.

Posts

  • MartinBauligMartinBaulig DEXamarin Team Xamurai

    Can you try to set the project configuration to "Release" mode, does this fix it?

    In theory, the linker should remove the System.ServiceModel reference when you're not actually using it.

  • I tried setting the configuration to Release, and it did not fix it.

    I have isolated the issue in a simple project that I have attached to this post, as well as a screenshot.

  • OnurGumusOnurGumus USMember

    The problem is , PCL has two different modes. Legacy and New. If you target .net 4.5 without silverlight , then it means you use new PCL profiles. From my impression I realized, Xamarin is still hostile against new profile and considers it 3rd party libraries. Add silvelight profile to your PCL classes then you will be working in Legacy mode.

  • zacgzacg CAMember

    I tried onurgumus suggestion adding silverlight and it still includes system.servicemodel ... has there been any update on this issue?

Sign In or Register to comment.