Debugging Silverlight Modules ?

Jan 9, 2009 at 12:23 PM

i have been working on my first Composite Application in Silverlight, and i am now facing this very annoying problem.

I cannot debug my application when it is running hosted on a Web app. When i start debugging, the app stops in the breakpoints, placed in the Bootstrapper and Shell class, and i can also step into the CAL code.
However, i cannot step into my modules code ( Silverlight class libraries ) nor infrastructure code.

I can parcially debug it on the automatically generated test page of the Silverlight app,
however i have a WCF service reference in the infrastructure project which gives me Cross Domain Boundaries error, so this is not viable. It has to be done on the web app.

On the web project properties i have silverlight enabled debugging, and it is also correctly binded to the Silverlight application.

Can anyone point me some directions ?

Thank you,
Jan 9, 2009 at 6:31 PM
Hi frantic0, 

I think you'll be glad to know that you can easily debug the Silverlight/WCF environment :)  We'll get you through it.

First I'd go to the app.Silverlight.Web (website) project, right-click, and select Web tab.

I would check ASP.NET, Native Code and Silverlight.    <=======

To get into your WCF service what you want to do is run your application in Debug mode and then do the following
   + Click on Debug
   + Click on Attach to process
   + Scroll down until you see ASP.NET Development Server - Port xxxx.  One will be grayed out (it's the Website)
   + Click on the entry that is not grayed out and click "Attach"

You'll now be able to step through your WCF service.   Sometimes I have to put breakpoints early in processes and step through it to get to where I want to be - on occassion it just blows by my breakpoint but I've yet to have a problem with an entry point (first lines of method) not breaking when it should.

Note: I lost half a day when trying to debug Javascript code (which is supported in VS2008). 


The following blog should get you through the Cross Domain issue :  CrossDomain Blog; since learning this I now keep my WCF service as a separate project (reusability).

You'll want to review this blog cast for issues I ran into with WCF and Prism - it many save you some debug time
  +  Prism/WCF - Cannot find ServiceReferences.ClientConfig in .xap application package

May 5, 2009 at 2:41 AM


Are your instructions intended for debugging a XAP that is not included in the shell project??  This is what I'm trying to achieve and I'm running into a wall here. 

At this point, I've got two instances of Visual Studio running.  In the first, I've got the project for a Module and I've attached the debugger to a development server process that originated from running the Shell project in another instance of Visual Studio. 

Is this not the way to go about debugging the module code??