11

I am unable to hit a breakpoint on the server side of a Silverlight web application. I know the code executes as I can break on the asynchronous callback with what I was expecting. It's only my machine with this issue.

I am aware this seems to be a common question, however all the answers to the ones I have seen have not helped me, including:

  • The breakpoint is red indicating it will be hit.
  • Silverlight checkbox is checked on the web project's properties.
  • Clean & build the solution.
  • Getting a new version from source control.
  • Cleared everything from my web browser: cache, cookies etc... (I am using IE).
  • Clearing the temp files in %windir%/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files.
  • Checked that all projects are being built in the configuration manager.
  • Everything set to debug and not release in the configuration manager.
  • Manually attaching to the w3wp.exe process.
  • IIS reset.
  • IIS is set to use .NET v4 and the pipeline set to classic not integrated.
  • Reinstalled IIS and freshly configured.
  • Reinstalled Visual Studio.
  • Reinstalled Silverlight.

I am using Visual Studio 2010 (.NET 4), Silverlight 4, and using IIS (I think 6, cannot remember) to host the site.

Interesting behaviour I have discovered (may help to diagnose):

  • It will still not break if I use Visual Studio's own development server to host the site instead of IIS.
  • I saw a blog post (cannot remember where or I would provide a link) under Debug -> Windows -> Proccess (Ctrl D, P) to check that the w3wp.exe process is set to "Silverlight" under the "Debugging" header - mine was set to "Managed" and was unable to set it to silverlight when attaching. After checking a colleagues settings on a machine which was working, his was also set to managed.

Any suggestions will be very appreciated!

UPDATE: Thanks for all the suggestions. I decided to format C:\ instead of spending more time playing around, as my machine needed it badly anyway. I still am not sure what the problem was, but it is working now.

I did try a couple of other things before this such as deleting the .sou files, and checking I was running the same version of Silverlight, mentioned in this blog post, with no luck. Hopefully this will act as a checklist for people with this problem in the future.

6
  • Isn't your application configured as Out-of-Browser? I've experienced various debugging-related problems with that setting turned on (it can be changed somewhere in project properties, don't remember the exact place now). Commented Jul 17, 2012 at 17:46
  • Thanks for the comment. And it only runs within the browser. I'll have a look for that setting tomorrow - I am not at work at the moment to test it.
    – DJH
    Commented Jul 17, 2012 at 17:55
  • Urgh, I often have similar issues, usually trying in different browser helps... You may try to test in Chrome for example. Attach to chrome.exe process that uses Silverlight and try - that may be temporary fix... Commented Jul 17, 2012 at 20:49
  • Thanks for the suggestion, I will give it a try tomorrow. I am not too confident that's the problem, but I am willing to try anything!
    – DJH
    Commented Jul 17, 2012 at 21:03
  • 4
    I see you went with the nuclear option. I like it.
    – DanTheMan
    Commented Jul 18, 2012 at 16:25

3 Answers 3

3

As you are working with Silverlight, you should not attach to w3wp.exe. This is a worker process for IIS and is not relevant to your Silverlight code. The browser process actually executes your Silverlight code. Could you try opening your Silverlight hosting page in IE and then use Visual Studio to attach to iexplore.exe (checking again for Silverlight as the code type you want to debug)?

This should allow you to debug your Silverlight code without any problems.

0

It seems that you already tried almost everything. You might want to check ServiceReference.ClientConfig file. Sometimes WCF service updates causes address and port changes. You can check it with Fiddler also to see where your services calls directed.

0

I know I'm late to the party, but I had this issue a while back in my Silverlight solution. It turned out that the problem was that I had the 'Enable Just My Code (Managed Only)' option checked in Tools>Options>Debugging>General; after un-checking this, my breakpoints were all hit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.