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.
Created attachment 8380 [details]
System.InvalidProgramException: Invalid IL code in .: (): IL_002c: call 0x0600000c
Works on .net
So the problem is this code in the method decorated with the AsyncStateMachine attribute:
IL_0027: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ''.''/'<test>d__0'::'<>t__builder'
IL_002c: call class [mscorlib]System.Threading.Tasks.Task ''.''/'В'::'њ'(object)
Here, we are loading the address of a valuetype and passing it as an object.
It's a compiler issue then?
No, same IL works on .net
The obfuscator creates invalid il code, and ms.net somehow accepts it, probly by auto boxing the struct. So the problem has nothing to do with the mangled names.
Do you guys know which obfuscator is doing that?
This would allow us to figure out if it's something we want to support or not.
The obfuscation used was 9-Rays Spices: http://www.9rays.net/Category/55-spicesnet-obfuscator.aspx
Could you share your spices.project (.iloprj).
We're trying to reach our to the obfuscator vendor to have them address the problem in their product and they need those files.
Created attachment 8660 [details]
9-Rays Obfuscator Project
I attached the App1.iloprj file that was used to create the problematic exe. Thanks for your help!
Created attachment 8663 [details]
Console Application Source Code
Attaching ConsoleApplication1.zip, which contains the source code.
I've been in touch with the obfuscator company to help them fix it.
We have no plans to support invalid programs just because dotnet under some circumstances does.