Bug 16507 - PLP targeting .NET Portable Subset Profile1 cannot compile with latest Xamarin Studio 4.2.1/Mono runtime 2.10.12
Summary: PLP targeting .NET Portable Subset Profile1 cannot compile with latest Xamari...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 4.2.x
Hardware: Macintosh Mac OS
: High normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2013-11-29 00:29 UTC by Claudiu T
Modified: 2013-12-02 00:41 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

PCL & iOS demo solution with Xamarin 4.2.1 defaults (16.31 KB, application/zip)
2013-12-02 00:19 UTC, Claudiu T

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Claudiu T 2013-11-29 00:29:47 UTC
I have an existing project targeting runtime Mono 2.10.12 and one of the projects is a Portable Library Project (PLP) targeting .NET Portable Subset Profile 1. Everything was working fine until I updated my Xamarin tools (Studio,MonoTouch,etc.) to the latest version.

After the update, when I try to compile the PLP project I get an error for the System assembly reference "Assembly not found for framework .NET Portable Subset (.NET for Windows Store apps, .NET Framework 4, ...)"

Also the reference to the PLP project is broken and it shows the error: "Incompatible target framework (.NET for Windows Store apps, .NET Framework 4, ...)"

=== Xamarin Studio ===

Version 4.2.1 (build 1)
Installation UUID: 8833c95e-1379-4019-adb9-323beacdb5ca
	Mono 3.2.5 ((no/964e8f0)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (
	Package version: 302050000

=== Apple Developer Tools ===

Xcode 5.0.2 (3335.32)
Build 5A3005

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 23a0827
Build date: 2013-11-11 16:04:00-0500

=== Build Information ===

Release ID: 402010001
Git revision: 844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 22:12:16+0000
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

=== Operating System ===

Mac OS X 10.9.0
Darwin  13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
Comment 1 Mikayla Hutchinson [MSFT] 2013-11-30 21:57:33 UTC
Mono does not include reference assemblies for PCL Profile1.

In the past, before Mono shipped any PCL reference assemblies at all, Xamarin Studio had a hack to build PCL projects against the Xamarin.iOS framework. This was technically incorrect, but would work in some cases. That's probably why it used to work for you.

Now that we have PCL reference assemblies, the hack has been removed. Please change your project to target a PCL reference framework that we support.
Comment 2 Claudiu T 2013-11-30 22:05:07 UTC
Alright, but what is the PCL reference framework that Xamarin supports currently? Can you please give me more details how should I fix this? Thanks
Comment 3 Mikayla Hutchinson [MSFT] 2013-12-01 06:24:44 UTC
There are many - all the ones that MS supports in VS2013. You can find & choose them in the Project Options framework selector.
Comment 4 Claudiu T 2013-12-02 00:19:48 UTC
Created attachment 5575 [details]
PCL & iOS demo solution with Xamarin 4.2.1 defaults
Comment 5 Claudiu T 2013-12-02 00:23:07 UTC
Comment on attachment 5575 [details]
PCL & iOS demo solution with Xamarin 4.2.1 defaults

The attached solution is build using Xamarin 4.2.1 First I created the PCL project which defaults to Profile 136. Then I did create the iOS project and try to reference the PCL project, which shows the error mentioned in the first post. Could you please explain what I'm doing wrong here? and how do I fix referencing the PCL project? I'm not doing anything manually, all is done through the Xamarin Studio therefore I assume it should work, right?
Comment 6 Mikayla Hutchinson [MSFT] 2013-12-02 00:27:36 UTC
Do you have the Mono MDK or the Mono MRE? Only the MDK includes the PCL reference assemblies.
Comment 7 Claudiu T 2013-12-02 00:31:59 UTC
I don't think so. All I did was to upgrade to lastest stable Xamarin Studio. As far as I'm aware Mono MDK is installed by Beta/Alpha versions of Xamarin Studio, right? Can you please let me know what exactly should I do to have this work? Thanks
Comment 8 Claudiu T 2013-12-02 00:36:40 UTC
After some searching I've found this: http://forums.xamarin.com/discussion/10710/cannot-use-pcl-in-ios-app-incompatible-target-framework-net-portable-subset-xamarin-studio

Is Benjamin Mayrargue's recommendation the official approach to have this PCL issue fixed with the latest Xamarin Studio?
Comment 9 Mikayla Hutchinson [MSFT] 2013-12-02 00:41:59 UTC
That shouldn't be necessary.

Make sure you remove any manually installed PCL frameworks by deleting the folder:

(Beware that files/folders starting with a '.' are hidden on MacOS)

Then install the MDK from http://www.go-mono.com/mono-downloads/download.html to make sure you have the MDK (the updater would update MRE->MRE, so if you ever installed the MRE at some point in the past you would still have it).