Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Debugging Silverlight Out-Of-Browser Applications

Blogs

Mike Taulty's Blog

Elsewhere

I was watching Joe Stegman’s talk at PDC09 about “Improving and Extending the Silverlight 4 Sandbox” and I learnt something that I felt I really should have known already and had a bit of a “D’oh!” moment but I’m not too proud to share my ignorance.

You probably know this already but…

If you’re working with a Silverlight out-of-browser application project in VS ( 2008 Sp1 or 2010 ) – i.e. if you’ve done at least the following steps;

image

then your application will spring up and you’ll hit your breakpoint. However, if you now take that application out-of-browser;

image

then you’re breakpoint won’t hit because VS thinks you want to debug Silverlight code in the browser and doesn’t realise that you want to debug Silverlight code inside of SLLauncher.exe which provides the hosting for out-of-browser Silverlight apps.

Now, up until seeing Joe’s talk I’ve been getting around this by manually changing my settings to cause the debugger to launch SLLauncher with the right parameters for my SLOOB and asking to debug Silverlight code inside of that process but it turns out that there’s an automatic setting for that already. All you have to do is set the Silverlight project to be the startup project;

image

and then change the debug properties on that Silverlight project;

image

and you’re in business debugging the SLLauncher process rather than IE.

Ok – if you’re thinking “did he not already know that?” then the honest answer is “nope” but I’m glad I do now :-)


Posted Sat, Nov 21 2009 2:48 AM by mtaulty
Filed under: ,

Comments

Sanjeev Agarwal wrote Daily tech links for .net and related technologies - November 21-23, 2009
on Sat, Nov 21 2009 10:54 PM

Daily tech links for .net and related technologies - November 21-23, 2009 Web Development ASP.NET MVC

Steve Trefethen wrote re: Debugging Silverlight Out-Of-Browser Applications
on Sun, Nov 22 2009 8:09 PM

I was looking at this the other day and didn't "already know it" either. :)

Thanks!

Wardy wrote re: Debugging Silverlight Out-Of-Browser Applications
on Tue, Nov 24 2009 7:44 AM

Hey Mike,

Nice to see you're as daft as me sometimes.

I'd be interested to see what the team has to say on this because I tested it and it worked for about a day then stopped.

here's my senario posted in the SL forums ...

forums.silverlight.net/.../146108.aspx

Bit wierd ... but in theory the steps you took should work every time ... i'm leaning towards bug here ...