using System; using System.Reflection; using System.Reflection.Emit; class Test { static void Main(string[] args) { AssemblyName name = new AssemblyName(); name.Name = "foo"; AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run); ModuleBuilder mod = ab.DefineDynamicModule("foo"); TypeBuilder tb = mod.DefineType(@"Foo\\"); ConstructorBuilder cb = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes); cb.GetILGenerator().Emit(OpCodes.Ret); Type baked = tb.CreateType(); foreach (ConstructorInfo ci in baked.GetConstructors()) { Console.WriteLine(mod.GetConstructorToken(ci)); } } }