Run WPF application in browser

Koscik picture Koscik · Jun 23, 2013 · Viewed 23.7k times · Source

I have my application wrote in WPF. Now, i want it to run in browser so I've read about it and I know that XBAP is my solution.

What is my problem? It won't run on my PC. I checked every popular browser (chrome, FF, IE, opera) and nothing. Browsers can't handle .xbap files and just downloads it. I try and try and nothing but above happened. Can anyone guess why it don't work? Is it deprecated technology, i have too-new browsers or what? Every entries I found about it are 2-4 years old.

Answer

Colin Smith picture Colin Smith · Jun 23, 2013

Firstly for Internet Explorer (IE9 onwards) you need to ensure that you have enabled XBAP/XAML support:

enter image description here

For Firefox and Chrome you have to do something a bit different:

But in addition to the above you need to be aware that when you run an XBAP application it runs in the Internet Zone....so your biggest problem is that normally you don't have full-trust...therefore your application can't call privileged code...if it tries to then you get security exceptions.

One way to get your XBAP to be "trusted" is to get it signed with a certificate (you should purchase a proper one from Verisign rather than use a test certificate) and deployed with ClickOnce.

Or you can keep your application as a regular WPF .EXE and use ClickOnce to deploy it from a website but run it locally with full trust.