Debugging managed Silverlight applications on a web server: Make sure that PDB can be served!

17 August 2007

[RAW]

A common question I’m asked is “Why can I debug fine in Visual Studio 2008, but not once I’ve copied my assembly and debug symbol to my web server?”  The answer is most likely that your web server isn’t serving debug symbol files (*.pdb).

If you’re using a Linux web host, you shouldn’t need to make any changes—Apache typically comes preconfigured to serve pdb’s without issue.  So this is a post for Windows web server users.

I’ve covered some of this before, but hey here’s the “with pictures” version for adding the MIME entry on an IIS 7.0 machine (either running Vista or Windows Server 2008).

First, verify the issue is that the PDB cannot be served

On the local web server, request the debug symbol file (pdb) for your assembly and see if you’re offered to download it, or provided with an error message.  An HTTP 404.3 message indicates that the MIME type is restricted and cannot be deleted.

What you see when IIS denies a PDB file
Note: You will only see this error when you're requesting localhost I believe... otherwise its a truncated message.

If you can’t get debugging going, but PDBs are being served fine, unfortunately this post won’t help you—but do leave a message and I’ll look into your problem.

Second, add the MIME type

  • Start InetMgr
  • Select the level within your machine and the web services that are running to add the MIME type to.  I’d recommend adding this at the machine level (click on your machine name, in my case JWMACBOOKPRO) instead of to an individual web site if possible.
  • Double-click on the MIME types feature entry in the main content pane.
    Adding the PDB MIME type
  • Verify that the “pdb” MIME type is not listed
  • Click “Add” under the Actions menu (far right corner of the screen)
  • In the form... extension “pdb”, and I typically use “application/octet-stream” for the MIME type
  • Click Ok and you should be good to go!  Re-request the file and see if its served to you!  You might want to reset the web server process just to be sure also.

Hope this helps!

[/RAW]

Jeff Wilcox is a Software Engineer at Microsoft in the Open Source Programs Office (OSPO), helping Microsoft engineers use, contribute to and release open source at scale.

comments powered by Disqus