PCL assembly reference issues

Hi!

I am trying to reuse the Core PCL of a WinRT app. The app was built using MvvmCross and contains the shared classes are in my Core project. The project contains HttpClient and makes use of the async/await functionality.

I have created a Xamarin.iOS project and tried to re use my Core project in the iOS project. I have encountered a few issues and managed to solve a few of them by Google'ing. However I am now stuck on an issue I can't solve, hopefully someone can help me out.

I am on the alpha channel. I have added a reference to my Core project in my iOS project. When I build I receive the following issues:

The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

The type 'System.Threading.Tasks.Task`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I have read a few forum posts where people said they have solved this issue but none of the fixes seem to be applicable to my scenario.

Is there anything I'm missing?

Posts

  • softlionsoftlion ✭✭✭ FRBeta ✭✭✭

    What profile is your pcl lib using ? (check by looking at the properties of the ".NET Portable subset" reference). What nuget packages is your pcl lib using ?

  • JohnFoulkesJohnFoulkes USMember

    Profile7 for PCL

    MvvmCross and Newtonsoft.Json packages

  • nodoidnodoid ✭✭✭ GBMember, Beta ✭✭✭

    You'll probably find Newtonsoft.Json is at fault here. I've had no end of issues with it. There is a Newtonsoft.Json.Portable package if you grab the source code, I've tried building it, but so far can't get it working.

    One solution I have tried is to conditionally compile against either the Monotouch or Android components by playing with the .csproj file - it kind of works, but it's a lot of messing.

  • JohnFoulkesJohnFoulkes USMember

    I updated to the latest release on alpha channel and this is now fixed

  • PeerlessProgrammerPeerlessProgrammer ✭✭ USUniversity ✭✭

    Glad to hear the latest version will fix this!

    However, I had dependencies that wouldn't allow me to update to the latest Xamarin yet. Also, you may not want to use Alpha in a production environment. So here is the forum post that helped me eliminate the errors and build successfully...

    https://forums.xamarin.com/discussion/48736/android-and-ios-project-saying-i-am-missing-a-reference-to-system-threading

  • wallymwallym ✭✭✭ USInsider, Beta ✭✭✭

    I had this issue this evening. I went ahead and tried the suggestion. Unfortunately, I did not have a Facade directory. I also tried the .NET Reference directories. No love. I took the references out, decided to just build, and boom, the problem went away. I know, it makes no sense. I just wanted to share this incase anyone else has the issue.

    Wally

Sign In or Register to comment.