DLL loaded twice

Hi,

I was looking at DLLS used by a process using ProcessSpy and found that the process has loaded two DLLs for few of the system dlls like Systsem.Drawing.Dll, System.Windows.Forms.Dll etc.

For one of these DLLs the version is 0.0.0.0 and the other one has a valid version. Unfortunately, I can't add a snapshot of the window here. What I am wondering is, whether its pretty common to have this behavior or something is wrong in the taks, the way it is loading DLL.?

Thanks,

-Brajesh

[516 byte] By [brajeshkumar69] at [2007-12-26]
# 1
Guessing a bit: you might be seeing the native image of the assembly, created by ngen.exe and named System.Drawing.ni.dll
nobugz at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Your guess might be right, as I see that the version 0.0.0.0 is being loaded from

C:\windows\assembly\nativeimages1_v1.1.4322\system.windows.forms\1.0.5000.0__b77a5c561934e089_fa580ca7

and the other version is being loaded from C:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089

But, I thought, if NGEN loads it for faster processing, then it

shouldn't be loaded again. I am trying to figure out, if there is a

problem with the way DLLs are laoded for this app or something like

this is normal.

Thanks,

-Brajesh

brajeshkumar69 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 3
Yep, that's it. c:\windows\assembly\nativeimages_blabla stores the NGEN generated DLLs. The original DLL is still around for reflection, etc.
nobugz at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 4
Thanks for your answer!

I have just one more question. Does it mean that if we don't use

reflection in the code, then the second DLL will not be loaded at all

or it would still be loaded irrespective of the fact, where reflection

has been used or not ?

-Brajesh

brajeshkumar69 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 5
It will still be loaded regardless. It is loaded first, then the native image is loaded. Assemblies can't be unloaded from an AppDomain.
nobugz at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified