Sunday, January 2, 2011

Assembly Linker


Assembly Linker is useful if you want to create an assembly consisting of modules built from different compilers (if your compiler doesn’t support the equivalent of C#’s /addmodule switch) or perhaps if you just don’t know your assembly packaging requirements at build time. You can also use AL.exe to build resource-only assemblies, called satellite assemblies, which are typically used for localization purposes. This utility can produce an EXE or a DLL PE file that contains only a manifest describing the types in other modules. Letz see an illustration.

al /out:FullName.dll /t:library FirstName.netmodule LastName.netmodule

In this example, two separate modules, FirstName.netmodule and LastName.netmodule, are created. Neither module is an assembly because they don’t contain manifest metadata tables. Then a third file is produced: FullName.dll, which is a small DLL PE file (because of the /t[arget]:library switch) that contains no IL code but has manifest metadata tables indicating that FirstName.netmodule and LastName.netmodule are part of the assembly. The resulting assembly consists of three files: FullName.dll, FirstName.netmodule and LastName.netmodule.

Happy New Year 2011 with happy learning.

No comments:

Post a Comment