O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required