Wednesday, 1 December 2010

Debugging Silverlight application using Fiddler

Debugging RIA services is not always plain and simple. When you start a new application using RIA services if things are not setup properly you have initial hick-up for debugging the code. If you were using Authentication services then the error will be most common error that login failed without giving any other details. There are lot of blogs out there specifying how to debug this situation, but what I want to mention in this blog is that, use Fiddler when possible to see what is going between the wire.  It works just fine when your web site is hosted and you are monitoring the request and responses from client side.

When it comes to debugging the localhost environment only thing you need to remember is to start the web site as http://localhost./website (emphasis on the ‘.’ at the end of the local host). because of the limitation in fiddler, If you run the normal localhost, it will not monitor. So make sure you use ‘localhost.’ with that you should able to see all the traffic going between client and server.

This link has alternate way of doing it as well.  If you do not want to add ‘.’ at the end of the localhost or the solution in the fiddler web site, then other option is to modify the hosts files (%WINDIR%\System32\drivers\etc\hosts) and then add the following like

127.0.0.1 name

With that change if you would access the web site or the app, instead of calling http://localhost now you can call http://name, fiddler will capture the traffic.

0 comments:

Post a Comment