2

I created a silverlight 4 app , and chose to host it in a ASP.NET Web Application. I added a Silverlight-enabled WCF Service to the Web Application Project.

The Web Application project is now set to be the startup project. This way every thing works fine and I can stop at breakpoints in the WCF services in the Web app project, and also stop at breakpoints in the silvelight project.

In the silverlight project properties, I changed it to be an OOB. This causes the startup project to automatically jump to the silverlight project. OK, so now when I debug the silverlight app it's opened OOB, but now I cant put breakpoints in the WCF services in the Web app project (Although the silverlight client can communicate with the web app project) . So I changed the startup project to the Web app again. But now the silverlight app doesn't start as OOB.

How can i debug in the WCF services, and run it OOB at the same time ? (My app is designed as an OOB, so it's important for me to develop it that way).

demongolem
  • 9,474
  • 36
  • 90
  • 105
Yaron Levi
  • 12,535
  • 16
  • 69
  • 118
  • When you switch to OOB double check your Web project and see if 'Enable Silverlight debugging' is still set. – Derek Beattie Apr 06 '11 at 13:29
  • @Derek Beattie I checked : ASP.NET and Silverlight are checked. Should I also check Enable Edit and Continue ? – Yaron Levi Apr 06 '11 at 13:35
  • What do you mean ASP.NET and Silverlight are checked? – Derek Beattie Apr 06 '11 at 13:41
  • Right click on the Web proj -> Web -> Debuggers – Yaron Levi Apr 06 '11 at 13:43
  • I see. I had this same problem and I'm trying to remember how I fixed it, I remember reading about setting OOB wipes out the debug settings or something. Did you try removing the link in the web project and re-creating it? – Derek Beattie Apr 06 '11 at 13:58
  • Right click on the Web project, go to 'Silverlight Applications' remove the Silverlight Project. Click on Add, and re-add the silverlight app. – Derek Beattie Apr 06 '11 at 14:23
  • I believe Jeff is correct, my app is runs oob and I was able to debug via attaching. I find it easier to debug in browser most of the time. – Derek Beattie Apr 06 '11 at 14:46

2 Answers2

2

First, You have to set a breakpoint on your client side, right before you call a service operation. Second, set another breakpoint inside the service method on the server side. Now, when you start debugging and hit the first breakpoint, attach the dev server process to the debugger by doing the following steps: click Debug - > Attach to process select the Webdev process and click attach.

now when you continue to debug, you will be able to debug your service as well :)

Eran Shalmon
  • 58
  • 1
  • 1
  • 5
0

When you start debugging, you should go into Visual Studio and manually attach the debugger to the development web server (Debug->Attach to Process...). This step is not done automatically when debugging OOB.

Jeff Yates
  • 61,417
  • 20
  • 137
  • 189