While working today I came across a requirement to debug a WCF Service from Silverlight and it took me one hour to find the solution, I had the above three assumptions met and I was not able to debug WCF Service from Silverlight.
I had the architecture of solution as below,
There is nothing unusual in the above architecture. I had Silverlight, Web Application and WCF as part of the same solution. The problems came when I tried to debug the WCF service from Silverlight. I was getting the below information at the breakpoint in the service side and I was never able to hit the service while debugging.
I binged a lot but did not get quiet good solution suggesting solving this. Eventually I found it very simple way to solve this.
Follow steps as below to hit the breakpoint in the service ,
Set the web application as the Startup project
Put a breakpoint on Xaml.cs and run the Silverlight application and upon hitting the breakpoint on the XAML page stop for a while
While the breakpoint on XAML is hit, select Tools from the menu and choose Attach to Process.
And then attach to the WCF host server.
Once after attaching to the WCF host server you should able to hit the breakpoint in the WCF Service from Silverlight.