Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run WPF application in browser

Tags:

browser

wpf

xbap

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.

like image 638
Koscik Avatar asked Jun 23 '13 14:06

Koscik


People also ask

Is WPF still relevant 2022?

“WPF would be dead in 2022 because Microsoft doesn't need to be promoting non-mobile and non-cloud technology. But WPF might be alive in that sense if it's the best solution for fulfilling specific customer needs today. Therefore, having a hefty desktop application needs to run on Windows 7 PCs with IE 8.

Is WPF still relevant 2021?

WPF is still one of the most used app frameworks in use on Windows (right behind WinForms).

What browser does WPF use?

A WPF Browser application is an app that runs in-browser as an XBAP (Xaml Browser Application). You can find a little more information on the uses and reasons to use XBAPs here. This thread on MSDN might help also.

How do I open a XAML file in my browser?

To open the XAML Designer, right-click a XAML file in Solution Explorer and choose View Designer. to switch which window appears on top: either the artboard or the XAML editor.


2 Answers

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:

  • How can I get my XBAP to run in my browser instead of downloading it on Windows 7?

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.

  • http://www.tarkia.com/blog/tag/difference-between-wpf-application-and-xbap-application/

  • http://www.tarkia.com/blog/2009/11/26/understanding-xbap-full-trust-partial-trust-certificates-and-more%E2%80%A6/

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.

  • http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/05/wpf-xbap-as-full-trust-application.aspx

  • http://blogs.microsoft.co.il/blogs/maxim/archive/2008/03/31/how-to-run-wpf-xbap-application-in-full-trust-mode-post-2-certificate-extraction.aspx

  • http://scorbs.com/2007/01/10/xbap-trust-levels/

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.

like image 156
CSmith Avatar answered Sep 30 '22 19:09

CSmith


not straight forward way, you can find you answer Microsoft MSDN Forum

like image 32
MineScript Avatar answered Sep 30 '22 20:09

MineScript