.NET executable process walk through
Is there a detailed walkthrough describing all the processes that occur at the .N开发者_如何学JAVAET level while running an executable? Like folders that are accessed, processes that might be running, who they are running as, etc. that happens outside of your application?
[I am not 100% clear what you mean by processes. If you mean procedures internal to the CLR, the answer below applies. If you mean OS processes outside of the CLR, never mind!]
I don't know if there is a detailed walkthrough. In any case, it's complicated. Starting up, the CLR reads lots of registry entries, machine.config, app.config, etc., resolves which DLL versions to load (a.k.a. .NET Fusion), etc.
The best way to get tremendous detail on this is to run your .NET app under ETW (Event Tracing for Windows). You can turn on OS event logging to observe all the OS interactions (reg entry reads, file reads, DLL loads, etc.), and can also enable logging of CLR level events. Then (post processing) you can collate (sort by time) all this information to get a fully detailed timeline of what happened when. I used to use this instrumentation to measure and tune CLR app startup time.
See also http://msdn.microsoft.com/en-us/library/ff357719.aspx for info on CLR ETW events.
Happy hacking!
精彩评论