I tried a simple web application using WCF as web service and web clilent is developing using silverlight sdk.4. But there's a problem when loading data to web page. Then I wanted to debug the application. Though I set break points in the code behind it directly goes to the web page without going through break points.Seems that it break points aren't hit.
Can anyone has this kind of experience? Please help me to resolve this problem
Loading
Priya LingePosted Nov 22, 2011, 11:45 PM
When we trying to set a breakpoint in codebehind, start the debug session from Visual Studio, and unfortunately, the breakpoint never gets hit.
Suppose We have Silverlight, Web Application and WCF as part of the same solution. Problems came when we tried to debug WCF service from Silverlight.
we getting some information at breakpoint in the service side and I was never able to hit the service while debugging
Follow steps as below to hit the breakpoint in the service ,
1.Set web application as Startup project
2.Put breakpoint on Xaml.cs and run Silverlight application and once hitting breakpoint on XAML page stop for a while
3.While breakpoint on XAML is in hit select Tool from the menu and choose Attach to Process option
4.And then attach WCF host server.
5.Once after attaching WCF host server you should able to hit the breakpoint in WCF Service from Silverlight.
Hope this will help you.
Thanks.
Priya LingePosted Nov 24, 2011, 11:43 PM
1.when our Silverlight application communicates with the server that served the application, the communication here is allowed because this is on the same
domain from where your app was served.
2.But when your Silverlight application attempts to communicate with a 3rd party
remote server, a policy must exist (which is defined in either the "clientaccesspolicy.xml" or "crossdomain.xml" file) that allows this communication.
1.clientaccesspolicy.xml file
The clientaccesspolicy.xml file is located where the service is being hosted.
But Silverlight also supports this file. "clientaccesspolicy.xml" is specific to Silverlight
If we want to grant multiple domains access, an admin simply can modify the clientaccesspolicy.xml file.
1.clientaccesspolicy.xml file
-
-
-
-
-
2.crossdomain.xml file
crossdomain.xml" was created originally for use with Flash applications.
-
When u occurs communicationException tht means u r cross domain error,
you have put these two files(clientaccesspolicy.xml and crossdomain.xml) files at service side,your error will be solved.
Hope this will help you.
Thanks.
sash crazPosted Nov 24, 2011, 8:50 AM
It helped me a lot. But there is another issue in my application. The connection between silverlight client and WCF service.i have added service reference to the client project. But when running communicationException occurs at Reference.cs file in silverlight.
The following is what I get. If U hv any clue of solving this please let me know.
sash crazPosted Nov 22, 2011, 8:46 AM
I checked what you have mentioned here. But in web.config files compilation debug is also set to true. But still getting the same problem. If you have any other hint to solve this problem ,please let me know.
Priya LingePosted Nov 17, 2011, 11:55 PM
• In Silverlight Application for debugging the WCF service
we have to enable debuggiing in the web.config file.
• Mark a breakpoint at the location in the client project where you want to start stepping (just before the WCF service call).
• Now, Run to the breakpoint, then begin stepping. The debugger will step into the service automatically.
Supose compilation debug="false" then breakpoints are not hit in silverlight
For more information please check below link.
http://www.dotnetfunda.com/articles/article557-how-to-debug-a-wcf-service.aspx
Hope this will help you.
Thanks.
Gomathi PalaniswamyPosted Nov 17, 2011, 12:59 PM