Defining Dynamic Method

Max Markov <[email protected]> Tue, 16 Mar 2004 19:25:01 +0300
Newsgroups gmane.comp.windows.devel.dotnet.rotor
Organization org
Message-ID <[email protected]>
Hello everyone,

Is there any API for creating dynamic methods with MSIL code.
Using Reflection.Emit is inconvenient, because we have to define
NEW dynamic assembly,types, members and so on. So the code looks like this:

/*----------------------------------------------*/
Assembly m_assembly = Assembly.LoadFrom(InFile);
AssemblyName assemblyName = new AssemblyName();
assemblyName.Name = m_assembly.GetName();

Assembly assembly = appDomain.DefineDynamicAssembly(assemblyName,
                                        AssemblyBuilderAccess.Save);

foreach(Module module in m_assembly.GetModules())
{
    ModuleBuilder em_module = EmitModule(module.Name);
    EmitTypes(module.GetTypes(),em_module);
}

/*---------------------------------------------*/

 Are there any opportunities?




--
Best regards,
 Max Markov

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

Guerrilla ASP.NET
15 March 2004, in Boston, MA
17 May 2004 in Torrance, CA
7 June 2004, London, UK

http://www.develop.com/courses/gaspdotnetls

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