Loaded module list.

F

Fabio Z

Hi all!

I'd like to get the list of loaded modules by my assembly, like VS does at
debug time in the loaded modules window.
I load some assembly via Assembly.LoadFile() and I'd like to retrieve these
assemblies in some way.

I tryied with

System.Reflection.Assembly.GetEntryAssembly().GetLoadedModules()

but all I get is the assembly of the main exe :(

Some help?

Thanks
 
V

Vadym Stetsyak

Hello, Fabio!

try AppDomain.GetAssemblies method.

To access your current AppDomain use AppDomain.CurrentDomain static property

You wrote on Fri, 15 Dec 2006 16:02:00 +0100:

FZ> I'd like to get the list of loaded modules by my assembly, like VS does
FZ> at debug time in the loaded modules window.
FZ> I load some assembly via Assembly.LoadFile() and I'd like to retrieve
FZ> these assemblies in some way.

FZ> I tryied with

FZ> System.Reflection.Assembly.GetEntryAssembly().GetLoadedModules()

FZ> but all I get is the assembly of the main exe :(

FZ> Some help?


With best regards, Vadym Stetsyak. E-mail: (e-mail address removed)
 
D

Dave Sexton

Hi,

First off, are you sure that there are multiple modules in the assembly to
begin with?

Modules are for multifile assemblies:

".NET Framework Developer's Guide, Multifile Assemblies"
http://msdn2.microsoft.com/en-us/library/168k2ah5.aspx

Visual Studio only builds one module per assembly, consisting of all of the
C# source code files and embedded resources within a single project. Unless
you built the assembly using managed C++ or the C# command-line compiler,
and used the Assembly Linker (AL.exe) then it will only have one module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top