Monday, June 17, 2013

Dynamic Assemblies

As the name suggests, Dynamic Assemblies are those which are created dynamically at runtime. They are not stored in any file before execution, after execution we can optionally store them in files. The System.Reflection.Emit namespace contains classes that allow a compiler or tool to emit metadata and Microsoft intermediate language (MSIL) and optionally generate a PE file on disk.

The Reflection.Emit namespace provides builder classes which can be used to create assemblies at runtime, these classes allow you to define classes and methods at runtime. The AssemblyBuilder is the core class which allows you to create assemblies at runtime.

AssemblyBuilder assemblyBuilder = curAppDomain.DefineDynamicAssembly(
assemblyName,AssemblyBuilderAccess.Save);

Search Flipkart Products:
Flipkart.com

No comments: