WPF 3.5 Sp1 WebBrowser in Partial Trust

This falls into the category of “learning something new every day”.

I’d always assumed that the WebBrowser control in WPF wouldn’t run in partial trust and, specifically, inside an XBAP.

I’d tried it. I’d hosted a WebBrowser control in an XBAP and then asked it to navigate somewhere and it’d thrown an exception and I’d kind of thought “Ok, fair enough – I wasn’t really expecting that to work”.

What I hadn’t ever done though was ask it to navigate to a page that was on the site origin and so I hadn’t realised that the exception I was seeing was a “cross-domain” exception rather than a “you can never make this work” kind of exception.

It took someone from the WPF team to set me right and point me at this example in MSDN which is why it was interesting to me in the first place – it’ll let you host Silverlight inside an XBAP;