Bug 22812 - A class which implements an interface member which has a delegate parameter or return value fails to compile
Summary: A class which implements an interface member which has a delegate parameter o...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.6
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-09-10 06:17 UTC by softlion
Modified: 2014-11-05 04:48 UTC (History)
3 users (show)

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

Project reproducing the bug introduced with the latest version of Xamarin (6.92 KB, application/octet-stream)
2014-09-12 07:47 UTC, softlion

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 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 softlion 2014-09-10 06:17:23 UTC
This example code won't compile with xamarin VS (ios It compiles fine with older version.

PCL project profile 49 (.net 4.5, WP silverlight 8, xamarin)

    public interface ICoolSettings
        event EventHandler<NetworkStatus> NetworkStatusChanged;

iOS app:

    public class Settings : ICoolSettings
        public event EventHandler<NetworkStatus> NetworkStatusChanged;

1>  C:\Program Files (x86)\MSBuild\12.0\bin\csc.exe /noconfig /nowarn:2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG /errorendlocation /preferreduilang:en-US /reference:C:\DiskJ\projets\Master\ac\Ac.Plugins.Settings\bin\Debug\Ac.Plugins.Settings.dll /reference:C:\DiskJ\projets\Master\ac\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.CrossCore.dll /reference:C:\DiskJ\projets\Master\ac\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.CrossCore.Touch.dll /reference:C:\DiskJ\projets\Master\ac\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Binding.dll /reference:C:\DiskJ\projets\Master\ac\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Binding.Touch.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\monotouch.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\System.Windows.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0\System.Xml.dll" /debug+ /debug:full /optimize- /out:obj\Debug\Ac.Plugins.Settings.Touch.dll /target:library /utf8output Plugin.cs Properties\AssemblyInfo.cs Reachability.cs Settings.cs "C:\Users\benjamin\AppData\Local\Temp\MonoTouch,Version=v1.0.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
1>  Microsoft (R) Visual C# Compiler version 12.0.30723.0
1>  for C# 5
1>  Copyright (C) Microsoft Corporation. All rights reserved.

error CS0012: The type 'System.Action`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Comment 1 Sadik Ali 2014-09-11 12:02:59 UTC
I have checked this issue but I am unable to reproduce this issue.

Steps I followed:

1. Create a PCL project.
2. Add a new class (Class name "Details")
3. Write the following code in Details class.

    public interface IempDetails
        event EventHandler<Details> EmpDetails;

    public class Details :EventArgs
        public int ID { get; set; }
        public string Name { get; set; }

4. Create an iOS "Single View Application".
5. Add the following code in default view controller.
    public class Settings : IempDetails
        public event EventHandler<Details> EmpDetails;
        public void GetEmp()
            Details obj = new Details();
            obj.ID = 1;
            obj.Name = "Foo";
        void EmployeeDetails(Details e)
            EventHandler<Details> handler = EmpDetails;
            if (handler != null)
                handler(this, e);
6. Add the following  code in view controller.
      Settings obj = new Settings();

7. Add PCL reference to iOS project.
8. Build the solution

When I build the project I am not getting any build error/exception. I am able to deploy application successfully on device and simulator.

Screencast: http://www.screencast.com/t/zMawq1yF

Please let me know if I am missing anything?

Could you please provide sample application and build information? So that we can reproduce this issue at our end.

Environment Info:

Windows Info:

Windows 7
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Professional
Xamarin (9a4fd01eaf32adf894f8bd1d687455dcb905f427)
Xamarin.Android (62e09eb09d3a9056653f1ef497de30b53bf04f47)
Xamarin.iOS (1ed3187e662f3b5a059fa6df4d7c480046290ea3)

Mac Info:

Mac OS X 10.9.3
Xamarin Studio: 5.3 (build 440)
Mono 3.8.0 ((no/45d0ba1)
Xcode 6.0 (6256.20)
Xamarin.iOS : (Enterprise Edition)
=== Build Information ===
Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859
Comment 2 softlion 2014-09-11 12:27:00 UTC
of course
Comment 3 softlion 2014-09-11 12:31:02 UTC
I don't have access to Xamarin
Comment 4 softlion 2014-09-11 15:12:30 UTC
I use
Comment 5 softlion 2014-09-12 07:47:08 UTC
Created attachment 8024 [details]
Project reproducing the bug introduced with the latest version of Xamarin
Comment 6 softlion 2014-09-12 07:47:28 UTC
I attached a repro project
Comment 7 Sadik Ali 2014-11-05 03:26:20 UTC
I have checked this issue with the help of bug description.

I observed that attached project build successfully on latest Stable (XVS 3.7.248) and getting build error on( XVS .

Could you please let me know are you facing same behavior ?

You can download latest XVS stable via In VS Tools->option->Xamarin-> Stable-> check for update.
Screencast : http://screencast.com/t/JKYBWzqJg4DE

Screencast regarding this issue:
 XVS : http://screencast.com/t/rKDvwRuE0ont
 XVS : http://screencast.com/t/JqX9n0MZaXt

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin (f0292f78c3976674afa3d78f7609b21973a3bd22)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (62e09eb09d3a9056653f1ef497de30b53bf04f47)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (1ed3187e662f3b5a059fa6df4d7c480046290ea3)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 8 softlion 2014-11-05 04:47:37 UTC
I moved to XVS 3.8 a month ago. It fixes more problems than the stable version.

I suppose it is fixed.
Comment 9 softlion 2014-11-05 04:48:22 UTC
i mark it as fixed