19

I am working on a cross-platform Xamarin app targeting iOS and Android, using Stuart Lodge's excellent MvvmCross framework.

Microsoft recently released new versions of their Portable Class Library BCL packages, and Stuart describes how to setup a project with these in http://slodge.blogspot.com.au/2013/11/quick-run-through-using-pcls-in.html.

When using PCL profile 158, one has to add the BCL async package and do some tweaking in order to make the iOS project work.

When using PCL profile 78, this seems to work automatically, with no need for the BCL packages.

Why would one use profile 158 over profile 78?

Geir Sagberg
  • 9,632
  • 8
  • 45
  • 60
  • 2
    It's my understanding that you can't currently use 78 for Xamarin due to reflection differences between 4 (used by profiles like 104, 158) and 4.5 (used by 78) - but hopefully your "portable-class-library" and "xamarin" tags will attract people who know more definitive answers. – Stuart Nov 15 '13 at 14:35

2 Answers2

15

Profile158 supports more platforms. Specifically it can run on Silverlight 5, where as Profile78 can't. Also, Profile158 uses the "older" reflection APIs, so if you have existing code which uses reflection it's likely to be easier to port to Profile158.

All else being equal though, I'd recommend using Profile78 unless you have a reason not to. It should work on Xamarin, if not then report it as a bug. :)

Daniel Plaisted
  • 16,674
  • 4
  • 44
  • 56
  • 1
    I was not aware of the new reflection API. Found a nice [MSDN Blog post](http://blogs.msdn.com/b/dotnet/archive/2012/08/28/evolving-the-reflection-api.aspx) for anyone else interested. – Geir Sagberg Nov 15 '13 at 19:25
  • 1
    Looks like Profile78 just became the new (yet to be released) default -> monodevelop/master d7f8378 Jeffrey Stedfast: [Core] Change the default PCL profile to Profile78 – sshaw Feb 26 '14 at 21:21
6

In addition to Daniel Plaisted's comment, profile 78 is missing few more types

  1. System.Threading.ThreadPool
  2. System.Threading.Timer

Both can be workaround by creating a plugin with specific implementation for each platform or referencing an older framework who does have these and wrap these types, see timer-in-portable-library

In addition to that, microsoft released a powerfull set :Immutable-Collection,
which supports PCL but isnt supported in silverlight and therefor isnt supported in profile 158 but is supported in profile 78.

Community
  • 1
  • 1
Kobynet
  • 983
  • 11
  • 23