Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or Developer Community 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.
I have come across an error where the order in which PCLs are referenced can cause a failure. In the attached test case, there are four projects projects:
Profile158 (Portable Profile158)
Profile158-2 (Portable Profile158)
Profile7 (Portable Profile7)
Profile158-2 references project Profile158. AndroidBuildTest references the other three.
In AndroidBuildTest.csproj, if Profile158 appears before Profile158-2, everything is fine. However, if Profile158-2 appears before Profile158, any cs file referencing Profile7 fails with this error:
error CS0012: The type `System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
=== Xamarin Studio ===
Version 4.2.2 (build 2)
Installation UUID: 092b839b-e4ba-41d0-8ccc-a3bdbc960f0d
Mono 3.2.5 ((no/964e8f0)
GTK+ 2.24.20 theme: Raleigh
Package version: 302050000
=== Apple Developer Tools ===
Xcode 5.0.2 (3335.32)
=== Xamarin.iOS ===
Version: 184.108.40.206 (Business Edition)
Build date: 2013-02-12 20:04:08-0500
=== Xamarin.Android ===
Version: 4.10.2 (Business Edition)
Android SDK: /Users/ddunkin/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)
4.0.3 (API level 15)
4.3 (API level 18)
4.4 (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
=== Xamarin.Mac ===
Xamarin.Mac: Not Installed
=== Build Information ===
Release ID: 402020002
Git revision: c5f82958ae7d9af652b44b87ceff777b3ad19b91
Build date: 2013-11-19 15:35:40+0000
Xamarin addins: a4044fee09138f6fd031a9944b7caaeb51e57e80
=== Operating System ===
Mac OS X 10.8.5
Darwin WS1681.local 12.5.0 Darwin Kernel Version 12.5.0
Sun Sep 29 13:33:47 PDT 2013
Created attachment 5769 [details]
Well, there are two problems here:
(a) Your Mono is too old, the CS0012 will go away when you use xbuild from Mono 3.2.6.
You are using direct references to the sub-project outputs. This should be considered an expert option and only used when there is a good reason for it and you know what you're doing. In this case, the following applies:
(b) You must not use xbuild on the entire solution or use the "Build" command in Xamarin Studio. This is not supported and the result will be random. All the sub-projects must be built separately. I would recommend to remove them from the solution and manually copy their output to some "lib" directory.
Directly referencing the output of other projects should be considered an expert option and only used when there is a good reason for it.
If this is not what you want, then use Project References (point (b) won't apply in this case); your .csproj should look like this:
In Xamarin Studio, right-click References, select Edit References, remove the three .dll references, then switch to the "Projects" tab and check the sub-projects. This will get you project references.
Btw. Visual Studio has this option to specify the "Build Order" which makes direct references to sub-project outputs less of a problem.
I'm not actually referencing the output of other projects, that was just a convenient way to demonstrate the problem. I'm glad it will be fixed in the next release.