Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

What is Managed Module in .NET and how is it different from Assemblies? Is a PE file (eg. test.dll) a managed module or an assembly? How does assembly/managed module correspond to physical files on disk?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
212 views
Welcome To Ask or Share your Answers For Others

1 Answer

A Managed module is generally understood to refer to a module that only contains IL code, with no direct machine code.

A module is housed in a normal PE file.

An assembly is a set of 1 or more modules, with one designated as the 'head' (will look up the exact term[1]). A module on its own isnt individually much use though - the assembly is the atomic unit.

For example, you could have an multui-module assembly with 2 DLLs and an EXE. Multi module assemblies are quite rare though.

The Don Box book Esssential .NET, the Richter CLR via C# gives good coverage of the topic. For complete details, the Serge Lidin .NET 2.0 IL Assembler book and the CLI standard are more complete.

[1] According to http://www.programmersheaven.com/2/FAQ-DOTNET-DOTNET-Assembly-Explained

An assembly can be a single file or it may consist of the multiple files. In case of multi-file, there is one master module containing the manifest while other assemblies exist as non-manifest modules

To answer the actual questions:-

What is Managed Module in .NET and how is it different from Assemblies?

It is a subset - a DLL can be a master module with no child modules -- and thus be an assembly too

Is a PE file (eg. test.dll) a managed module or an assembly?

Definitely a module. If it also has a manifest and no child modules, it's also an assembly

How does assembly/managed module correspond to physical files on disk? Each module is a file. (Tools like ILMerge can merge modules if you're interested)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...