How can I define multiple types with the same name and different type parameters using Reflection Em

Posted by wawa on Stack Overflow See other posts from Stack Overflow or by wawa
Published on 2010-03-16T20:26:18Z Indexed on 2010/03/16 20:31 UTC
Read the original article Hit count: 118

Filed under:
|
|
|

How can I generate types like these using the System.Reflection.Emit libraries:

public class Test<T> {}
public class Test<T1, T2> {}

When I call ModuleBuilder.DefineType(string) with the second type declaration, I get an exception because there is already another type in the module with the same name (I've already defined the type parameter on the first type). Any ideas?

© Stack Overflow or respective owner

Related posts about reflection.emit

Related posts about generics