tags:

views:

427

answers:

3

I'm using VWD Express 2008 to develop a WPF Browser Application. When I start debugging, it launches the XBAP in my default browser, which is Opera. Obviously, XBAPs don't work in Opera, so I have to repeatedly right-click on the document to open in IE.

Is there any way to change the settings for PresentationHost.exe so that it always opens with IE? A registry setting, perhaps?

A: 

XBAP does work in Opera (and I can make a screenshot to prove the point). Consider updating your Opera version and/or .NET (do you have SP1?).

Pavel Minaev
I just updated Opera a couple of weeks ago to 9.64, so that's not it. Pretty sure I have the latest SPs for .NET. How did you get XBAPs to run inside of Opera?
Albert Walker
I must admit that I do not know what exactly did I do that made it work, but it works. One piece of the puzzle might be that I'm using the most recent Opera 10 alpha.
Pavel Minaev
A: 

Check out this post on the msdn forums.

The workaround I found works OK, but requires that Firefox be your default browser:

In Firefox, open the menu Tools / Options / Downloads.

Then click on "View & edit actions" and change the action for XBAP applications to the Windows Presentation Host.

Now when I debug, Firefox receives the XBAP, but then it automatically pass it to the presentation host, which runs into IE. A bit cumbersome, because everytime a new tab gets opened in Firefox, but it's OK. It also works with F5, so you can debug.

Alternatively, you can start IE, navigate to the XBAP URL and then manually attach the debugger to the PresentationHost process (not to IE though).

Lucas McCoy
Your post gave me an idea... basically I did the equivalent in Opera, which is:Preferences -> Advanced -> Downloadsselect "application/x-ms-xbap" MIME typeEdit -> select Open with other appication in textbox enter "C:\Program Files\Internet Explorer\iexplore.exe"check "Pass Web address directly to application"This automatically opens the XBAP in IE, but just like your solution, I'm left with a blank tab in Opera. It would be nice to see if there are any better solutions out there.
Albert Walker
+1  A: 

A simple and easy way to do this is to associate *.htm or *.html (don't remember exactly, try both) files with IE, and it will work for XBAP.

UPDATE:

Solution described above works for "Start external program option".

For "Start browser with URL" option you actually can set default browser in Visual Studio. I don't find how to set it through Tools -> Options, but you can achieve it by following steps:

  1. In your solution explorer find a file which meant to be viewed in browser (e.g. *.htm, *.svc)
  2. Right click on this item and choose "Browse With..."
  3. In the opened window you'll see a list box with installed browser and one of them will be marked as default.
  4. In the list box Choose "Internet Explorer" and click "Set as Default" (if there is no IE browser in the list just add it).
Oleg I.