How can we trace the assembly loading sequence on windows service startup?
For example. When we start a service it loads all the reference assemblies and their dependencies; what i want to do is that which assemblies (OS, CLR or etc) are being loaded before actually starting the service.
You can use the
AssemblyLoadevent onAppDomain.CurrentDomainfor this.Note that this will only work for assemblies that are loaded from the point you add the event.
mscorlibfor example is already loaded before theMainis called because you need this to be able to runMain.Of course, if you create the domain yourself, you can add this event before the domain is started and you should see all the loaded assemblies.