How to troubleshoot Silverlight RIA Applications

On May 19, 2010, in How-to, Technical, by Frank Cheung

It’s difficult to troubleshoot Silverlight applications built with WCF RIA services on a production environment because:

1) RIA Domain services is a virtual file and you will not find it in the directory structure.
2) Any exception thrown by the domain service will NOT be shown on the Silverlight client.  It will only show up as a 404 Not found error.  Without the real error, it’s very difficult to troubleshoot the problem.

In this post, I’m going to show you how to get the real error returned by the RIA domain service.

In this example, I am using the HR Application sample downloaded from Microsoft.  With the Silverlight application, all I am seeing is the Not Found error which is not very helpful.



To get the real error returned by the domain service, you will need to install the HTTP Debugging Proxy tool, Fiddler.

Once you have Fiddler installed, you can fire up a Fiddler session and start capturing the HTTP requests.

In the Fiddler trace below, you can see that the request made to the domain service, /riarc2test/ClientBin/HRApp-Web-AuthenticationService.svc/binary/GetUser, returned a 500 error.  In the web view on the right hand pane, Fiddler will display the real error returned by the domain service.


Also note that /riarc2test/ClientBin/HRApp-Web-AuthenticationService.svc does not exist on the server but you’ll get the same error if you browse to this URL.

Frank Cheung
CTO

 

2 Responses to “How to troubleshoot Silverlight RIA Applications”

  1. Gabor says:

    It’s okey, if we get the 500 error, but what if we get a 404 NotFound error, and we can’t navigate to the DomainSrvice via url?

    How to establish, the DomainService existance, and how to establish where is the error at runtime, where everything work well in development environment and on the local IIS (wich is on the same machine)?

    Thanks in advance

    Gabor

Leave a Reply

iBlog by PageLines