Attaching a debugger to the silverlight client of a deployed LightSwitch app

Introduction

I recently encountered a problem which only pops up in the deployed application (in production so to speak) and which is not reproducable when running the LightSwitch application in debug. Furthermore, the problem happened client side (in the silverlight code). As a result, activating tracing server side on the IIS server didn’t have any sense.

I tried without any result, to attach the debugger to the browser connected to the LightSwitch application . I always got “The breakpoint will not currently be hit”:

 

The magic solution

The magic solution is to install the silverlight debug helper which installs as a Visual Studio Extension and runs in the background until a Silverlight debug session is started. It can be downloaded here: http://visualstudiogallery.msdn.microsoft.com/b5f1634e-1608-4376-8f00-caf93f5f58c8

How to attach a debugger to the browser?

Just for completeness: select from the menu in  visual studio:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Secondly, make sure to select the correct browser instance.

 

You will see now that the breakpoint red bullets are now nicely solid, and they will be hit: