Debugging Services Consumed from Silverlight

by Marcel Veldhuizen 17. April 2011 12:16

If you're used to debugging ASP.NET web applications together with WCF services, you will know that Visual Studio automatically attaches the debugger to the service process in addition to the website. When you It doesn't do this for services being called from Silverlight. Instead, Visual Studio will probably warn you that the service call will fail, but we've taken care of that problem with the behavior extension from the previous post.

The solution is fairly obvious: you will have to make sure that the debugger is attached to both your web application and your service.

You can manually attach the debugger to an extra process, or use the Multiple startup projects feature. Right-click the top line in the Solution Explorer and select Set StartUp Projects. In the following dialog, make sure that both projects are set to Start and that Multiple startup projects is selected: Multiple startup projects dialog

Once you've done this, both projects will be started when you press F5. Visual Studio will launch the WCF Test Client for your service, which you might not need. You can disable this behavior in the project options, under the Debug tab: WCF Library project debug tab Remove the text /client:"wcftestclient.exe" from the command line arguments (highlighted in the screenshot) if you want to stop the test client from being run. If you want to disable it temporarily, a nice trick is to change it to /clientArgs:"wcftestclient.exe" and remove the Args bit when you need the test client again.

Tags: , ,

Programming | Silverlight

Comments (1) -

Javier Costa Rica
1/27/2012 10:03:13 AM #

This is what I was looking, it's good!

In WCF project properties, below Web, I prefered to check: "Don't open a page. Wait for a request...".

Thanks!

Reply

Add comment

Marcel Veldhuizen

Software Architect by profession, mostly focused on Microsoft .NET technology.

Metal enthusiast; I love going to concerts :)

 

RecentPosts

Recent Tweets

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation