I would like to get a list of all the dlls loaded for a given Process. I am currently using .NET Framework 4.0. I am aware that there is a bug when trying to access all managed dlls through the Process.Modules property. (Only lists the unmanaged dlls). I need a way to programmatically retrieve all of these dlls.
Process[] myProcess = Process.GetProcessesByName("MyProcess");
if(myProcess.Count() > 0)
{
foreach (ProcessModule processModule in myProcess[0].Modules)
//get information
}
EDIT: The process I am interested in is not in the current AppDomain.