1

I have been reading clr via c# book and it says

A managed module is a standard 32-bit Microsoft Windows portable executable (PE32) file or a standard 64-bit Windows portable executable (PE32+) file that requires the CLR to execute.

And other question in stackoverflow What is a module in .NET? says that

A module is a logical collection of code within an Assembly

But my question is how is this logically collected? On what basis?

Is a managed module created for single .cs file or a user defined type or for a particular namespace?

Community
  • 1
  • 1
Dilip Nandakumar
  • 198
  • 2
  • 14
  • Logically collected? You mean logically connected? – Yuval Itzchakov Apr 20 '15 at 13:58
  • You are talking about an *assembly*, the linked question is talking about a *module*. Not the same thing in .NET. An assembly can have more than one module, but that's quite unusual. The "basis" you are asking about it covered by al.exe, the assembly linker. It glues modules together to create an assembly. A tool you'll never use. Modern computers have plenty of memory to be able to build an assembly in a single compile step. – Hans Passant Apr 20 '15 at 14:12
  • @HansPassant So what you are saying is a single assembly contains a single managed module ? Does that mean a single .csproj ie assembly get compiled into a single managed module. If so could you please illustrate an example where a assembly can have multiple managed modules ? – Dilip Nandakumar Apr 20 '15 at 16:08
  • @YuvalItzchakov No my question is ,the Intermediate language code in a single managed module contains the compiled code of all files in a single .cs file or single class or single namespace or a particular assembly ? And i am confused because in the book clr via c# it says an assembly can have multiple managed modules. – Dilip Nandakumar Apr 20 '15 at 16:14

1 Answers1

0

http://blogs.msdn.com/b/junfeng/archive/2005/02/12/371683.aspx

The above link answers my question.

So as i understand a multiple managed modules are created in an assembly when multiple languages are used in a single assembly.

This being only one scenario. The other scenarios on what basis a managed module is created is explained in the above link.

Dilip Nandakumar
  • 198
  • 2
  • 14