.net - What might cause this ExecutionEngineException? -


I am trying to use reflection escorted Amit to generate the wrapper class for dynamic assembly automatic wrapper generation A new open source library is part of what I've been calling "GoInterfaces"

wrapper class tool IEnumerable & Lt; String & gt; and the wraps from the list & lt; String & gt; . In C # words, it does all:

  class list 1_7931B0B4_79328AA0: IEnumerable & lt; String & gt; {Private redoni list & lt; String & gt; _obj; Public list 1_7931B0B4_79328AA0 (list & lt; string & gt; obj) {this._obj = obj; } IEnumerator IEnumerable.GetEnumerator () {return._obj.GetEnumerator (); } Public Seal IEnumerator & lt; String & gt; GetEnumerator () {this return._obj.GetEnumerator (); }}  

However, when I try to call the GetEnumerator () method on my wrapper class, I get the Execution exception exception. So I saved my dynamic assembly in DLL and used ildasm on it. What's wrong with the following code:

  .class public auto ANSI seal List`1_7931B0B4_79328AA0 [mscorlib] extends System.Object implements [mscorlib] System.Collections.Generic.IEnumerable`1 & LT ;? String & gt;, [Loyce. Order] loyce Serial.imoInterfaceWeap {.field private Initonely class [MScLib] system. Selection. Genre.list` 1 & lt; String & gt; _obj .method Public Disguised Virtual Ultimate Example Class [mscorlib] System.Collections.Generic.IEnumerator`1 & lt; String & gt; GetEnumerator () cil managed {// code size 12 (0xc). MaxStack 1 IL_0000: ldarg.0 IL_0001: ldfld class [mscorlib] System.Collections.Generic.List`1 & lt; String & gt; List`1_7931B0B4_79328AA0 :: _ obj IL_0006: Phone examples ValueType [mscorlib] System.Collections.Generic.List`1 / enumerator & LT; 0 & gt; Class [mscorlib] System.Collections.Generic.List`1 & LT; String & gt; :: GetEnumerator () IL_000b: retired} // method end List`1_7931B0B4_79328AA0 :: GetEnumerator public hidebysig virtual final example class [mscorlib] System.Collections .method .IEnumerator System.Collections.IEnumerable.GetEnumerator () cil managed {.override [Mscorlib] System.Collections.IEnumerable :: GetEnumerator // Code Size 12 (0xc). MaxStack 1 IL_0000: ldarg.0 IL_0001: LDFed Class [MScorlib] System.Collections.Generic.List`1 & lt; String & gt; List`1_7931B0B4_79328AA0 :: _ obj IL_0006: Phone examples ValueType [mscorlib] System.Collections.Generic.List`1 / enumerator & LT; 0 & gt; Class [mscorlib] System.Collections.Generic.List`1 & LT; String & gt; :: GetEnumerator () IL_000b: Retired} // Law List `1_7931B0B4_79328AA0 End :: System.Collections.IEnumerable.GetEnumerator ...  

I have a test suite that is available for all types of Wrap different things, which includes many interface methods with interface and signature from other interfaces. This only happens when I IEnumerable & lt; T & gt; I try to wrap up this problem that if I want, I would be happy to send source code (2 * .ei files, no dependencies).

list & lt; T & gt; In fact 3 GetEnumerator () methods; It is clearly IEnumerable.GetEnumerator () and IEnumerable & lt; T & gt; GETEnumerator () applies, but returning a public GetEnumerator () method is a list & lt; T & gt; Kanumitr example, telling your code that method, type a value, and so Call and ret between the Box < Need to insert / code> opcode.

Another issue with your il is that your explicit interface implementation should not be public, it should be private. There are some other small differences too, but I do not think any of these can be the cause of the exception.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -