wpf 如何让我的 XBAP 在浏览器中运行而不是在 Windows 7 上下载?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7337155/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I get my XBAP to run in my browser instead of downloading it on Windows 7?
提问by Rachel
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.
在我的旧 XP 计算机上,从 Visual Studio 运行 XBAP 会在 Google Chrome 中打开它。我切换到 Windows 7,现在运行 XBAP 会像下载 ZIP 或 EXE 一样下载文件,而不是在浏览器中打开它。同样的事情发生在 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 hereif anyone wants).
是的,我知道 XBAP 不打算在 Chrome 上运行,但是如果您将一堆 FireFox dll 复制到 Google\Chrome\Application 目录,它运行得很好(如果有人想要,请在此处执行步骤)。
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.
甚至在我进行该设置之前,它仍然会尝试在 chrome 中打开一个 xbap,我可以将 URL 复制到 IE 进行测试。现在它下载文件,所以我什至不能这样做。
采纳答案by Rachel
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
明白了... Firefox(和 Chrome,因为我使用 FF dll 在 Chrome 中运行 XBAP)通过使用来自 .Net 3.5 安装程序的 dll 运行 XBAP,并且由于 Windows 7 已经安装了 3.5,这个 dll 不是'可用
To fix this, I needed to copy the file
为了解决这个问题,我需要复制文件
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\NPWPF.dll
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Windows Presentation Foundation\NPWPF.dll
from an XP machine to
从 XP 机器到
C:\Program Files (x86)\Mozilla Firefox\plugins
C:\Program Files (x86)\Mozilla Firefox\plugins
(if FireFox folder doesn't exist, create it)
(如果 FireFox 文件夹不存在,请创建它)
Also in case you're looking to do the same, I think thiswas the link I used to figure out what FF files I needed to copy to Chrome's installation directory:
另外,如果您想这样做,我认为这是我用来确定需要将哪些 FF 文件复制到 Chrome 安装目录的链接:
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
在 Mozilla Firefox 安装目录中找到的以下库
C:\Program Files\Mozilla Firefox
必须复制到 Chrome 安装目录:
- js3250.dll
- mozcrt19.dll
- nspr4.dll
- nss3.dll
- nssutil3.dll
- plc4.dll
- plds4.dll
- smime3.dll
- sqlite3.dll
- ssl3.dll
- xpcom.dll
- dll文件
假设Chrome安装在以下目录,USER对应你的windows用户。
C:\Users\[USER]\AppData\Local\Google\Chrome\Application
回答by denolk
MIME Type Extension
application/manifest .manifest
application/x-ms-xbap .xbap
application/octet-stream .deploy
application/x-ms-application .application
application/vnd.ms-xpsdocument .xps
application/xaml+xml .xaml
Maybe it is related with the file extentsions?
也许它与文件扩展名有关?