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
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.
Created attachment 9394 [details]
Customer is trying to have an interface with events in it to be implemented a concrete class inside a Xamarin project. This code works well on a regular C# project but when using Xamarin it is presenting this error:
## Compilation Errors:
error CS0738: 'MobileDeviceManager' does not implement interface member 'IMobileDeviceManager.MyEvent'.
Additions\MobileDeviceManager.cs(16,18,16,37): error CS0012: The type 'System.Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Additions\MobileDeviceManager.cs(16,18,16,37): error CS0012: The type 'System.EventHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Additions\MobileDeviceManager.cs(16,18,16,37): error CS0738: 'GertecBinding.MobileDeviceManager' does not implement interface member 'ClassLibrary2.IMobileDeviceManager.Chupa'. 'GertecBinding.MobileDeviceManager.Chupa' cannot implement 'ClassLibrary2.IMobileDeviceManager.Chupa' because it does not have the matching return type of 'System.EventHandler'.
They do have an implementation of the event and the exactly same code in regular C#.
## Steps to reproduce:
1. Load attached project in Xamarin Studio
I have checked this issue and with the help of attached project I am able to reproduce this issue.
Build Output: https://gist.github.com/RamChBachkheti/d0e8956246f11d499cc3
IDE logs: https://gist.github.com/RamChBachkheti/6870876c1f020edddd06
Additional info: I have checked the same application on OS X and observed that attached project is build and deployed successfully in OS X
Please let me know if I can provide more info to this issue.
=== Xamarin Studio ===
Version 5.7 (build 661)
Installation UUID: b6495454-eed9-49ee-a97b-abf8a686d664
Microsoft .NET 4.0.30319.34003
GTK+ 2.24.22 (MS-Windows theme)
=== Xamarin.Android ===
Version: 4.20.0 (Trial Edition)
Android SDK: D:\SDK\AndroidSDK
Supported Android versions:
1.6 (API level 4)
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.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: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode)
=== Build Information ===
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 11:27:37-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7
=== Operating System ===
Windows 6.2.9200.0 (64-bit)
What's funny is that I can't repro this on OS X. The primary difference is with the _GetAdditionalResourcesFromAssemblies target:
On my working build, the Assemblies output includes:
In fact, *all* of my assembly references are resolved from the Xamarin.Android framework, as opposed to the Build Output in Comment #2, e.g.
This is rather puzzling to me. :-(
@Ram: Does this directory:
> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0
contain a Facades directory with System.Runtime.dll?
Is it possible to get Diagnostic build output?
What's odd is that the diagnostic build output in Comment #4 does *not* invoke the ImplicitlyExpandDesignTimeFacades target, and the $(ResolveReferencesDependsOn) property doesn't include it either:
Oh well - so many sleepless nights because of that! There's some kind of advanced dark magic involved in this, but unfortunately I don't remember exactly how that worked :-(
What we should do is run the diagnostics output with a working test case - keep using the same PCL Profiles, but remove stuff until it compiles while still using System.Runtime.dll. Then add one of the types back to make it fail again and compare the build output. Is the compiler invocation still the same?
You should never see
anywhere when building Xamarin.Android.
Ping me on Slack tomorrow and we can look at this together.
Closing ancient bugs, please reopen if you're still having this problem.