What is a module in .NET?

A module is a logical collection of code within an Assembly. You can have multiple modules inside an Assembly, and each module can be written in different .NET languages (VS, as far as I'm aware, doesn't support creation of multi-module assemblies).

Assemblies contain modules. Modules contain classes. Classes contain functions.

Yes you can access assemblies, modules, classes, functions, properties, fields etc all via reflection at runtime.


As an addition to the other answers:

The MSDN states that: "A module is a Microsoft intermediate language (MSIL) file that does not have an assembly manifest.".

Modules can be "linked" together by generating an assembly manifest using the Assembly Linker (al.exe) utility. If i remember it correctly the CLR can load individual modules for an assembly, so that only the neccessary modules get loaded.

EDIT: Found a better description of the Netmodules and why you would want them.

There is another question here on SO that touches the checksum subject. The answers mentions using the GetILAsByteArray method for getting the IL.


A file

That's what a module is.

module: A single file containing content that can be executed by the VES

(Where VES is a program which reads .NET assembly and converts it to machine code.) see http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf Partition I page 16.

--

An assembly is coherent collection of files in the filesystem (modules). See http://msdn.microsoft.com/en-us/library/zst29sk2(vs.71).aspx

Obviously class definitions are defined inside the file (module) itelf.