Bug 8092 - Unable to add references to PCL's on OSX
Summary: Unable to add references to PCL's on OSX
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Android Add-in ()
Version: 3.0.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2012-10-30 22:02 UTC by Douglas Linder
Modified: 2014-04-04 15:33 UTC (History)
2 users (show)

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

Screenshot of reference errors in monodevelop on OSX (117.73 KB, image/png)
2012-10-30 22:02 UTC, Douglas Linder

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 Douglas Linder 2012-10-30 22:02:33 UTC
Created attachment 2820 [details]
Screenshot of reference errors in monodevelop on OSX

When choosing 'edit references' in Monodevelop for a PCL, no options are listed in the 'Packages' tab, and the references are all marked in red with the tip: 

'Assembly not available for .NETPortable 4.0 Profile1 Profile (in Mono 2.10.9)'

I'm forced to manually edit the .proj file and add additional references there.

This is a terrible user experience and gives the impression that PCLs are completely broken, when though they actually are not.

Screenshot of this not working attached.

Mono develop version information is as follows:

Installation UUID: 4e64d821-ca1e-400a-9895-cc911737e3f7
	Mono 2.10.9 (tarball)
	GTK 2.24.10
	GTK# (
	Package version: 210090011
Apple Developer Tools:
	 Xcode 3.2.2 (1650)
	 Build 10M2148
Mono for Android: 4.2.6
Android SDK: /Users/douglasl/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1 (API level 7)
		2.2 (API level 8)
		2.3 (API level 10)
		3.1 (API level 12)
		4.0 (API level 14)
Java SDK: /usr
Build information:
	Release ID: 30004007
	Git revision: ea0108260c6a376ecaeffcdb7d03387bd51edda3
	Build date: 2012-09-17 14:09:17+0000
	Xamarin addins: ec43fd5cb223ead4234a9858d1b56eef03dad53a-dirty
Operating System:
	Mac OS X 10.6.8
	Darwin per-ms025.win2k.iinet.net.au 10.8.0 Darwin Kernel Version 10.8.0
	    Tue Jun  7 16:32:41 PDT 2011
	    root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64
Comment 1 Jeffrey Stedfast 2012-11-16 16:54:25 UTC
The problem is that PCL libraries aren't available on MacOS X, they are only available on Windows (because Mono doesn't yet generate PCL assemblies).

The way PCL works on MacOS X is that we link with the MonoTouch or MonoDroid assemblies and pretend that they are the same as the PCL libraries (they aren't, but it's good enough in that it works for the intended purpose of building MonoTouch and MonoDroid apps)

I think the only way to fix this will be to figure out how to generate all of the PCL assembly profiles and bundle them with Mono.
Comment 2 Stuart Lodge 2012-12-19 05:05:00 UTC
Is this fixed by https://bugzilla.xamarin.com/show_bug.cgi?id=7173
Comment 3 Jeffrey Stedfast 2012-12-19 09:19:27 UTC
Unfortunately, no.  That fix just makes it possible to build against profiles other than Profile1 but doesn't fix the "assembly not available" bug that this bug report is about.
Comment 4 Stuart Lodge 2012-12-19 09:30:26 UTC
Thanks for the explanation.

Given the update, couldn't we you use the same type of 'interim solution' to get PCLs working against MonoMac/Xam.Mac too?

i.e. can't PCLs build against the Mono framework for MonoMac in the same way they build against the droid and touch assemblies for those platforms?

I appreciate this is not ideal - but it is an interim solution which works really well for monotouch.

Sorry if I've misunderstood anything - only just did my first MonoMac stuff this last weekend.
Comment 5 Jeffrey Stedfast 2012-12-19 13:00:20 UTC
We do, actually. Things should build fine but editing the references is going to complain about missing references because the references don't actually exist (which is what this bug is about).
Comment 6 Stuart Lodge 2012-12-19 13:05:46 UTC
ah... ok... think I totally got the wrong end of the stick... but then I couldn't get any PCLs to work on MonoMac/Xam.Mac... 

Ignore me! I'll try again next year :) Just trying to rush things. Sorry!
Comment 7 Jeffrey Stedfast 2012-12-19 13:08:28 UTC
Oh, if it's not building for you on MonoMac/Xamarin.Mac - then that's a bug (but separate from this one).

If you file a bug, I'll try to make that a priority when I get back from vacation.
Comment 8 Stuart Lodge 2012-12-19 13:13:49 UTC
Let me do a clean install and build before I log anything (I was seeing all sorts of weird things but I was also confusing myself between M.M and X.M - http://forums.xamarin.com/discussion/599/portable-class-libraries-supported)

Next year :)

Over and out. (And sorry to Douglas for messing up this bug report)
Comment 9 Stuart Lodge 2012-12-30 07:43:27 UTC
Thanks Jeff - I've moved the PCL issues on Mac to https://bugzilla.xamarin.com/show_bug.cgi?id=9163
Comment 10 Stuart Lodge 2013-01-21 04:36:14 UTC
Any news on this or https://bugzilla.xamarin.com/show_bug.cgi?id=9163 ?
Comment 11 Stuart Lodge 2013-01-29 18:52:23 UTC
Do I stand any chance of getting 9163 looked at? I've got a pull request coming in for MvvmCross mac support that duplicates far too many .csproj files. So far I've just told them to hold fire based on the 'make it a priority' comment - but i'm guessing someone else has found a fair few other priorities for you :)
Comment 12 Stuart Lodge 2013-01-30 02:37:59 UTC
Looking at the diff, is there any hack I can put in to the csproj so I can get PCLs working in 3.1.1?

I couldn't seem to get any profile working before, but if there's a magic conditional csproj hack I can  add then it will mean I can merge https://github.com/slodge/MvvmCross/pull/126 and then Kevin and others can get on with xam.mac projects :)
Comment 13 Jeffrey Stedfast 2013-01-30 09:47:36 UTC
I'm not sure what part is failing, but it'll probably be a simple fix to make it "work", at least.

Michael Hutchinson just patched this code a bit after running into an NRE (perhaps this NRE is causing the failure you are seeing?)

See bug #9807 for his NRE & patch

I'll be looking into bug #9163 today and stepping through it to try and see where exactly things are failing. If I figure it out and patch it, I'll try and see if I can squeeze it into 4.0 (but I doubt it'll make it, I think QA got a "release build" yesterday).

If I can, I'll cherry-pick to 3.1.1 and roll a new dmg
Comment 14 Stuart Lodge 2013-01-30 09:50:43 UTC

Please don't rush out a patch for this. Do what makes sense for you guys to release/support it as part of the normal flow.

Besides, I'm not likely to get a window to look at Mac again until next week now at earliest - too busy for my own good :)

Comment 15 Stuart Lodge 2013-05-04 13:46:48 UTC
This works OK on iOS currently.... and maybe for .Mac projects (although there are other issues there)

But the Android project experience sucks - see https://www.youtube.com/watch?v=DUzoGJc9yys
Comment 16 Mikayla Hutchinson [MSFT] 2014-04-04 15:33:13 UTC
We shipped PCL support on Mac last year.