F.5 Compiling to modules


Instead of compiling your source file into an assembly, you can also compile it into a module ( .netmodule file). You can compile a C# source file into a module using the /target:module option. The following commands will generate Class1.netmodule and Class2.netmodule from their respective source files:

 c:\expt>csc /target:module Class1.cs c:\expt>csc /target:module Class2.cs 

To link both modules into a single DLL assembly, you can do this:

 c:\expt>al  /out:  Class3.dll Class1.netmodule Class2.netmodule 

AL.exe (Assembly Linker [6] ) is a tool which generates a file with an assembly manifest from one or more files that are either modules or resource files.

[6] Also known as the Assembly Generation Tool in Microsoft documentation.



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net