Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
BRH 48
#DOTNET 34
#ASP.NET 29
jQuery 22
ASP.NET 20
.NET 20
WPF 9
jquery interview questions 9
jquery faq 8
ASP.NET4 8

Archive · View All
February 2011 10
September 2011 4
August 2011 4
July 2011 4
May 2011 4
April 2011 4
March 2011 4
October 2011 4
June 2011 4
January 2011 4

WCF – Silverlight debugging tips

Jun 30 2011 12:46PM by Hima   

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

silverlight-debug

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.

silverlight-attachprocess-debug

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.

Some times you get CommunicationException as follows . System.ServiceModel.CommunicationException was unhandled by user code.If you get this error, then the WCF service is trying to tell you that something went wrong, but the full error information is not making it back to Silverlight. To fix this problem, add the following line to the MainPage constructor in your Silverlight application. This switches over to the new ClientHttp stack will fix the problem.

This line of code can be removed once done with the debugging.

WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);

You need to change this line in your WCF service Web.config file, and change this value to true as follows .

<serviceDebug includeExceptionDetailInFaults="true"/>.

This should give you much more information in your Silverlight client about what's going wrong.

  • You cannot debug Silverlight application and the applications hosting Silverlight together
  • Use Expression Blend to Edit the XAML File, Visual Studio supports integration with Expression Blend.

References

http://msdn.microsoft.com/en-us/library/dd470100(VS.95).aspx

Tags: BRH, .NET, #DOTNET, #ASP.NET, WCF, Silverlight,


Hima
31 · 6% · 1776
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"WCF – Silverlight debugging tips" rated 5 out of 5 by 1 readers
WCF – Silverlight debugging tips , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]