Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

On my old XP computer, running an XBAP from Visual Studio would open it up in Google Chrome. I switched to Windows 7, and now running an XBAP downloads the file like it were a ZIP or an EXE instead of opening it in the browser. The same thing happens in FireFox.

Does anyone know why I am suddenly downloading the file instead of opening it? And how I can fix it?

And yes, I know XBAPs are not meant to run on Chrome, but if you copy a bunch of FireFox dlls to the Google\Chrome\Application directory it runs just fine (steps here if anyone wants).

Even before I had that setup, it would still try and open an xbap in chrome and I could copy the URL to IE for testing. Now it downloads the file so I can't even do that.

like image 482
Rachel Avatar asked Sep 07 '11 16:09

Rachel


People also ask

How do I run an XBAP file?

Open Windows Explorer, go to the folder that contains the compiled version of your WPF Browser application and double-click the application (the . xbap file). This will launch the application. Perform the desired actions over the application.

How do I open XAML Browser application?

Step 1 : Open Microsoft Visual Studio 2010. Step 2 : Select File->New->Project. Step 3 : Select WPF Browser Application and then click Ok. Step 4 : Now drag two button controls and three label controls from the toolbox onto the design window of Page1.

What is .NET XBAP?

XBAP stands for XAML Browser Application. XBAP allows for WPF applications to be used inside a browser. The . NET framework is required to be installed on the client system. Hosted applications run in a partial trust sandbox environment.


1 Answers

Got it... Firefox (and Chrome, since I'm using FF dlls to run XBAPs in Chrome) runs XBAPs by using a dll from the .Net 3.5 Installer, and since Windows 7 comes with 3.5 already installed, this dll isn't available

To fix this, I needed to copy the file

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\NPWPF.dll

from an XP machine to

C:\Program Files (x86)\Mozilla Firefox\plugins

(if FireFox folder doesn't exist, create it)

Also in case you're looking to do the same, I think this was the link I used to figure out what FF files I needed to copy to Chrome's installation directory:

The following libraries found in Mozilla Firefox instalation directory C:\Program Files\Mozilla Firefox have to be coppied to Chrome installation directory:

  • js3250.dll
  • mozcrt19.dll
  • nspr4.dll
  • nss3.dll
  • nssutil3.dll
  • plc4.dll
  • plds4.dll
  • smime3.dll
  • sqlite3.dll
  • ssl3.dll
  • xpcom.dll
  • xul.dll

Assumming Chrome is installed in the following directory, USER corresponds to your windows user. C:\Users\[USER]\AppData\Local\Google\Chrome\Application

like image 84
Rachel Avatar answered Sep 19 '22 18:09

Rachel