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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.235.144