What does assembly GetTypes() do behind the scenes? Assuming an assembly has been loaded to the AppDomain does it still need to read from the physical DLL? And what the assembly manifest do?
Iterating through the assembly like this:
AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes())
I'm occasionally getting the following error:
Could not load file or assembly
Which tells me that because an assembly is loaded into the AppDomain it's not necessarily fully loaded to memory. Sometimes it still needs to go back to the file.
My questions:
- Why is it doing that?
- What can I do to detect these semi-loaded assemblies?