Issue was reported by a customer who was using the nuget package Portable.Data.Sqlite. However I was able to recreate this issue using the samples provided on github in the Portable.Data.Sqlite repository. The issue is that though the iOS sample and the referenced Portable.Data.Sqlite library compile and run fine in Visual Studio, the same fails in Xamarin Studio. I checked with both Mono 18.104.22.168 and Mono 22.214.171.124.
## Steps to reproduce
1. Download the Portable.Data.Sqlite repo from: https://github.com/ellisnet/Portable.Data.Sqlite and unzip
2. Open the Portable.Data.Sqlite solution from the root of the unzipped folder.
3. Build Portable.Data project.
4. Portable.Data.Sqlite projects.
Expected result: Portable.Data.Sqlite project will compile successfully as it does in Visual Studio.
Actual result: Project compile fails with the errors below:
> /Users/apple/Downloads/Portable.Data.Sqlite-master/Portable.Data.Sqlite/SQLiteConvert.cs(34,34): Error CS0584: Internal compiler error: Assembly 'System.Runtime.InteropServices, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is a missing assembly and does not support the requested operation. (CS0584) (Portable.Data.Sqlite)
> /Users/apple/Downloads/Portable.Data.Sqlite-master/Portable.Data.Sqlite/SQLiteConvert.cs(21,21): Error CS0584: Internal compiler error: Assembly 'System.Runtime.InteropServices, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is a missing assembly and does not support the requested operation. (CS0584) (Portable.Data.Sqlite)
> /Users/apple/Downloads/Portable.Data.Sqlite-master/Portable.Data.Sqlite/SQLiteConvert.cs(21,21): Error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement (CS0201) (Portable.Data.Sqlite)
> /Users/apple/Downloads/Portable.Data.Sqlite-master/Portable.Data.Sqlite/SQLiteConvert.cs(7,7): Error CS1684: Reference to type `System.IConvertible' claims it is defined assembly `mscorlib, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found (CS1684) (Portable.Data.Sqlite)
## Build Output: https://gist.github.com/jgold6/9faf8784e696defab395
## Version info
=== Xamarin Studio ===
Version 5.7.1 (build 14)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Mono 3.12.0 ((detached/de2f33f)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000068
=== Apple Developer Tools ===
Xcode 6.1.1 (6611)
=== Xamarin.Mac ===
Version: 220.127.116.11 (Business Edition)
=== Xamarin.Android ===
Version: 18.104.22.168 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
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.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
=== Xamarin.iOS ===
Version: 22.214.171.124 (Business Edition)
Build date: 2015-01-24 09:42:21-0500
=== Build Information ===
Release ID: 507010014
Git revision: a4dd61ad7f8b3695be4b17bcb5c3ae6b81438cf7
Build date: 2015-01-19 15:21:09-05
Xamarin addins: 081208fe3bbf40e24a562867c6c7fba20a9b94b6
=== Operating System ===
Mac OS X 10.10.2
Darwin Jons-iMac.local 14.1.0 Darwin Kernel Version 14.1.0
Mon Dec 22 23:10:38 PST 2014
Internal compiler error is fixed in master.
The build now fails with
../Portable.Data.Sqlite/SQLiteConvert.cs(470,7): error CS1684: Reference to type `System.IConvertible' claims it is defined assembly `mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089', but it could not be found
/Users/marek/git/bugs-repros/Portable.Data.Sqlite/Portable.Data/bin/Debug//Portable.Data.dll (Location of the symbol related to previous error)
which is probably little pedantic but correct as you are using DBNull which implement IConvertible but this PCL combination does not support IConvetible.
csc reports this as a warning but roslyn turned this into an error.
What is odd is that it builds in Visual Studio with the DBNull inheriting from IConvertible, which I do see is not available in the Windows Store Apps target platform. So I looked again and for some reason when this solution is opened in Visual Studio, the PCL is not targeting Windows Store Apps, but when opened in Xamarin Studio it does. So that explains the difference.
However I am unable to unselect Windows Store Apps in Xamarin Studio for this PCL project (likely a Xamarin Studio issue?). If I uncheck it, it is then implicitly selected and there is no change.
bug filed for issue noted in comment 4: https://bugzilla.xamarin.com/show_bug.cgi?id=26960
I didn't test this in VS but you could check from both build logs which PCL profile is used during build and it should be same in XS and VS otherwise it's XS (possibly xbuild) bug.
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 Links.
Create a new report for Bug 26753 on Developer
Community or GitHub if you have new information to add and do not yet see a matching
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
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.