10/23/10

Some useful debugging tools

TCP TRACE

I needed to grab and analyze a HTTP Web Request that was being made programmatically from a Windows application. My friend Chandra suggested that I look at the TCP Trace tool. It is a really cool tool that acts as a tunnel between a Client and Server.

This is how it works.When you start it, it pops a dialog as shown below:

Let us asume,the Windows application was making a HTTP Web Request to an ASP.NET web application on port 80. We need this request to be grabbed by the Tcp Trace. So in the window above, set the listening port of the trace to 80 so that it can catch the request. The request needs to be ultimately passed on to the web application which used to listen on port 80.So we change the application's port to another available port, say 8080. We then point the trace's destination port to 8080 on the same server.

After you make these changes and click ok, the Trace is ready to grab the requests coming on Port 80.Now when the windows application make a web request programmatically using the HTTPWebRequest class, the trace catches it. The trace has a visual interface(like fiddler) that enables you to look at the request in detail.

You can download it here.


DEPENDENCY WALKER

I was once integrating a third-party application into my existing application. My application started blowing up at the point of integration complaining about some missing functionality. I had all the third-party assemeblies necessary and was not able to make sense of the error messages. It then struck me that maybe the third-party assemblies are missing some dependency assemblies. I then came across a tool called Dependency Walker, which visually lists all the dependency assemblies for a specified assembly. When I loaded the third-party assembly using this tool,  it showed that I was missing two dependency assemblies. Once I got those assemblies, the application worked just fine.

You can download or find more information about the Dependency Walker here

No comments: