Bug 1900 - DynamicMethod throws exception when owner is specified.
Summary: DynamicMethod throws exception when owner is specified.
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-11-05 18:09 UTC by Martins Mozeiko
Modified: 2012-01-19 23:57 UTC (History)
2 users (show)

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


Attachments
code to reproduce (1.25 KB, text/plain)
2011-11-05 18:10 UTC, Martins Mozeiko
Details


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 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.

Related Links:
Status:
RESOLVED FIXED

Description Martins Mozeiko 2011-11-05 18:09:29 UTC
When I specify owner (Type) for DynamicMethod as argument, then somwhere internally Mono class libraries throws System.ArgumentException. MS.NET framework (2.0 and 4.0) works fine. Code to reproduce attached.

Unhandled Exception: System.ArgumentException: ModuleBuilder is expected
  at System.Reflection.Emit.SignatureHelper.GetMethodSigHelper (System.Reflection.Module mod, CallingConventions callingConvention, CallingConvention unmanagedCallingConvention, System.Type returnType, System.Type[] parameters) [0x00000] in <filename unknown>:0 
  at System.Reflection.Emit.ILGenerator.EmitCalli (OpCode opcode, CallingConvention unmanagedCallConv, System.Type returnType, System.Type[] parameterTypes) [0x00000] in <filename unknown>:0 
  at Test.Program.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: ModuleBuilder is expected
  at System.Reflection.Emit.SignatureHelper.GetMethodSigHelper (System.Reflection.Module mod, CallingConventions callingConvention, CallingConvention unmanagedCallingConvention, System.Type returnType, System.Type[] parameters) [0x00000] in <filename unknown>:0 
  at System.Reflection.Emit.ILGenerator.EmitCalli (OpCode opcode, CallingConvention unmanagedCallConv, System.Type returnType, System.Type[] parameterTypes) [0x00000] in <filename unknown>:0 
  at Test.Program.Main () [0x00000] in <filename unknown>:0
Comment 1 Martins Mozeiko 2011-11-05 18:10:08 UTC
Created attachment 829 [details]
code to reproduce
Comment 2 Zoltan Varga 2012-01-19 23:57:16 UTC
Fixed in HEAD/2.10.