Dear all,
I'm trying to emit an assembly with the following class using
System.Reflection.Emit:

class MyDynamicAssembly
{
        MyDynamicAssembly [] t;

        public static void Main(string [] args)
        {
        }
}

But I'm not able to do the following:

AssemblyName assemblyName = new AssemblyName();
assemblyName.Name = "MyDynamicAssembly";
AssemblyBuilder assemblyBuilder = domain.DefineDynamicAssembly(
                assemblyName,
                AssemblyBuilderAccess.RunAndSave);
ModuleBuilder moduleBuilder =
              assemblyBuilder.DefineDynamicModule("MyDynamicModule.exe");
TypeBuilder typeBuilder =
            moduleBuilder.DefineType("MyDynamicType", TypeAttributes.Public);
//THE NEXT METHOD CALL RETURNS NULL
Type t = assemblyBuilder.GetType("MyDynamicType[]");
//WITHOUT t WE ARE NO ABLE TO USE DefineField() METHOD
FieldBuilder fb = typeBuilder.DefineField("t",t,FieldAttributes.Public);

Does anyone know how to get a Type or TypeBuilder object for the
"MyDynamicType[]" type?

Thanks,
Bruno Cabral

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to