Process for Debugging .NET inner guts
I'm wondering about people's process when they try to learn about 开发者_Go百科the guts of .NET. Let me give a particular example to clarify.
Recently, we found an error with the StateServer we are using on our .NET website. Sometimes its its starts tossing errors and our site goes crazy. The StackTrace reveals this occurs when:
System.Web.SessionState.SessionStateModule.BeginAcquireState()
gets called. Is there a good way to learn more about SessionStateModule, BeginAcquireState and what's going on in there? MSDN doesn't seem to have anything about this method.
I'd like not only to fix the problem, but more generally to learn about the process and what's going on. What steps have others found helpful (I'll test the process to see how helpful it is on the particular error I mentioned :-) )
I often will grab .NET Reflector, and just look at the class in question.
If that isn't enough, you can also get the .NET Source code under the (MS Reference License). This lets you debug the framework directly.
Reflector might be useful.
Also, if you're curious about stack trace and performance involved on each method call, you can use ANTS Profiler.
If you just want to see what it does, and don't need to actually step through it in the debugger, then you want Reflector.
This will look at the IL of a compiled assembly and put it back together as source code in C# (or VB.NET or various other .NET languages, if you really want...).
Sure is. Open up the DLL in Reflector and take a look :-)
http://www.red-gate.com/products/reflector/
you can see exactly what's under the hood in the framework.
The source code for this class, with comments, is available from the Reference Source. I never had any luck getting the source server to work reliably, I strongly recommend the NetMassDownloader to get it. Half an hour of babysitting and you're set. Be sure to read John Robbins' usage notes in his blog.
精彩评论