Less is more

Brad Abrams reports four less dlls loaded in Whidbey than in Everett for his helloworld application.

*VERY* poor man's profiler

The four dlls are:

D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll

D:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorsn.dll

D:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll

D:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll

The first two dlls are not really “not loaded”. In Whidbey they are merged into mscorwks.dll. fusion.dll and mscorsn.dll still exist for backward compatibility reason, but they simply forward calls to the right dll (fusion.dll to mscorwks.dll, and mscorsn.dll to mscoree.dll).

The last two dlls are the IL images of mscorlib.dll and system.dll. In Whidbey only the native images of those two assemblies are reported by psapi.dll. This is due to some work we have done in Whidbey. For assemblies in GAC, we will not load the IL image if a native image exists.

A nature follow up question is that does it mean you can deploy native images without the IL images?

The answer is “No”. We still need the IL images to validate native images. We just won’t call LoadLibrary anymore. Psapi.dll’s APIs (the Win32 APIs System.Diagnotics.Process uses) can only report things loaded by LoadLibrary. Hence the IL images are not shown in the output.