.NET Framework Bookmark and Share   
 index > Building Development and Diagnostic Tools for .Net > How are modules and assemblies related?
 

How are modules and assemblies related?

So an assembly is like a dll, rightand what is a module? Is it like a source code file wthin an assembly?

lpszDan

You're mostly correct, depending on your definition of "source code file" (i.e. IL vs. C#, for example). One file of an assembly is a PE file (a .dll or .exe) which contains the assembly manifest. A module is IL code + associated metadata and can be in the same PE file or exist separately (in the case of a multi-module assembly). Have a look at http://msdn.microsoft.com/en-us/library/zst29sk2(VS.100).aspxfor a more detailed explanation.

Regards,
Jon

  • Friday, September 18, 2009 5:50 AMMike Stall - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    From the ICorDebug perspective, Assemblies contain modules. Modules have all the interesting stuff, like IL and PDBs.
    Some notes from the debugger perspective: http://blogs.msdn.com/jmstall/archive/2006/02/17/modules-vs-assemblies.aspx

    http://blogs.msdn.com/jmstall
  • All Replies

    • Friday, September 18, 2009 4:34 AMJon LangdonMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
       Answer

      You're mostly correct, depending on your definition of "source code file" (i.e. IL vs. C#, for example). One file of an assembly is a PE file (a .dll or .exe) which contains the assembly manifest. A module is IL code + associated metadata and can be in the same PE file or exist separately (in the case of a multi-module assembly). Have a look at http://msdn.microsoft.com/en-us/library/zst29sk2(VS.100).aspxfor a more detailed explanation.

      Regards,
      Jon

    • Friday, September 18, 2009 5:50 AMMike Stall - MSFTMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
       Answer
      From the ICorDebug perspective, Assemblies contain modules. Modules have all the interesting stuff, like IL and PDBs.
      Some notes from the debugger perspective: http://blogs.msdn.com/jmstall/archive/2006/02/17/modules-vs-assemblies.aspx

      http://blogs.msdn.com/jmstall
    • Friday, September 18, 2009 11:23 PMlpszDan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
       

      Thanks Guys, very much appreciated.

      So assembly contains a module. And each module has IL part and Metadata part.
      Does an assembly correspond to a namespace?

      I was experimenting with creating assemblies on the fly, that's why I got these questions. I wondered if LoadAssembly will be called when a new assembly is generated from the already running code. Cause I think this is something very powerful to .NET, to be able to just add in memory assemblies. And will it be possible to actually call a function through ICorDebugEval.

      How do in-memory assemblies get freed? Does a standard garbage collection mechanism just unload an assembly?

    Jon Langdon

    You can use google to search for other answers

    Custom Search

    More Threads

    • PSDK
    • Identify Finalizer Thread
    • How to test memory leaking
    • mscorlib in Framework 3.5 as compared with 2.0
    • Re: Debugging mscorwks
    • Finding and reading handle tables
    • Profiling API - Problems Processing Exception Unwind / Mixed Application
    • Obtaining the call stack when debugging a native application
    • CF Debugging with Mdbg: How to make .pdb available?
    • mscorlib.dll