This is a mirror of official site: http://jasper-net.blogspot.com/

WCF – Silverlight debugging tips

| Tuesday, February 15, 2011
Introduction

As all of us know if something went wrong in the Silverlight application that is consuming WCF, how much painful it is to investigate the problem. Debugging only help to certain level, as it do not always give the exact error message. It sucks and it eats considerable amount of time to know the problem and all that we end up in identifying nothing. If we know some smart tips in WCF +Silverlight  that will help us in reducing some time and identifying the issues.

Debug Silverlight Application

Method1.  If we directly place a break point it might not get hit. The problem might be Silverlight  Debugging is not enabled In order to Debug Silverlight application Go to Solution Properties , right click and select property pages -> Navigate to Start Options - >Debuggers -> select Silverlight checkbox

silverlightdebug_5F00_thumb_5F00_2F877F07.png

Method2. Using Visual Studio you can attach to an instance of your browser that has a Silverlight application running from the server (IIS). This is very useful especially as unexpected problems can occur once you deploy and run your application on the server. These problems you may not see when you just run locally on your box.

To accomplish this open up Visual Studio.

From the menu select Tools->Attach to process (Ctrl+Alt+P). This will bring up the following dialog.

silverlightattachprocessdebug_5F00_thumb_5F00_2DDBD495.png

We need to identify instance of the browser to attach the process,  Check Type =Silverlight 86 . Click on the attach button and  now we can debug the application.

The remote server returned an error: Not Found

Most common Exception in WCF with Silverlight is Message="The remote server returned an error: NotFound." And we are sure that something went wrong in the service no clue where exactly the exception happened. WCF never gives exact error. The only error it gives is remote server returned an error. In this case fiddler helps in identifying why the issue is. If we can identify the problem and why it is caused then it’s easy to find the solution. Make sure that you have any debugging tools like fiddler or web development helper , HTTP Snippet tools to debug and know what exactly happening . These tools will help us to know what exactly the error is.


Read more: Beyond relational

Posted via email from Jasper-net

0 comments: