Multiple File Assembly

The process of creating a multifile assembly takes some explaining, as does the use of some command line utilities. A key point to understand is that a multifile assembly can contain only one entry point. That is to say that only one class within the assembly can contain a Main method. Of course, if the multifile assembly is a DLL, this is not an issue. However, if the multifile assembly is an EXE, it is not possible for the assembly to contain more than one entry point.

To create the multifile assembly, it will be necessary to create two source files and compile them into code modules, which have the extension .netmodule by default. Listings 5.1.1 and 5.1.2 contain the source for very simple classes that will comprise ...

Get C# and the .NET Framework: The C++ Perspective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.