Showing posts from April, 2012

Mono for Android Portable Libraries in VS

Thanks to Scott Hanselman's recent article on .NET's support for Portable Class Libraries (PCLs), there has been some renewed interested in using them for Mono for Android.

If you try to add a reference to a compiled PCL assembly, things should work, as VS simply checks that the version of mscorlib.dll referenced is the same as the MFA project (2.0.5).  However, if you try to add a reference to a PCL project, you get this nasty dialog box:

The bad news is we don't ship any tooling for supporting these out of the box yet.  The good news is it's trivial to do it yourself!

The portable libraries are installed in .NET's Reference Assemblies folder, which is here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0

If you explore around in that folder, you will see there are something called "Profiles" which specify the common assemblies for a given set of targets.

For example, "Profile2" targets .NET 4, Silverlight 4, an…