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 for Bug 18324 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 6294 [details]
For this particular test case, the problem appears to be fixed on Mono 3.2.7 (currently on the Alpha channel).
## Steps to reproduce
1. Build and run the attached project using the Debug configuration in Xamarin Studio on Mac.
2. Click the "Hello World, Click Me!" button.
> UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in TestApp.MainActivity/<OnCreate>c__async0:MoveNext (): IL_0013: ldloc.1
> at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<TestApp.MainActivity/<OnCreate>c__async0> (TestApp.MainActivity/<OnCreate>c__async0&) <IL 0x00022, 0x000bb>
> at TestApp.MainActivity.<OnCreate>m__0 (object,System.EventArgs) [0x00000] in /Volumes/ramdisk/TestApp/TestApp/MainActivity.cs:29
> at Android.Views.View/IOnClickListenerImplementor.OnClick (Android.Views.View) [0x0000d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.Views.View.cs:900
> at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/0deb0164/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.Views.View.cs:867
> at (wrapper dynamic-method) object.6e58b830-e440-4754-a730-4092cfad80d6 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
A. Remove the `async` keyword from the button.Click delegate.
B. Change `Class1.DoSomeWork()` to an `async Task` method, and add `await` on the call to `class1.DoSomeWork()`
C. Upgrade to Mono 3.2.7, then clean, and rebuild the solution.
## Version information
- Xamarin.Android 4.12.1
- Xamarin Studio 4.2.3 build 60
- Mono 3.2.6
- OS X 10.8.5
The problem does not happen when the project is built and run from Windows.
I have checked this issue on below environments:
All MAC, Windows
XS 4.2.3 (Build 60)
Mono Mac 3.2.6
I followed steps mentioned as in bug description and noticed that same exception is generated when click on Hello World, Click Me!" button.
Screen cast: http://screencast.com/t/aaZEQIR6
Exception log: https://gist.github.com/Sadik1/9523454
I check this on Window machine and not getting any exception.
Also I check with Workarounds as mentioned in bug description and noticed that it is working