如何在 Intranet 上部署 WPF 4 Full Trust XBAP?

发布于 2024-08-31 17:18:25 字数 1063 浏览 5 评论 0原文

我在从 Intranet 运行使用 Visual Studio 2010 创建的完全信任的 WPF 4 XBAP(浏览器应用程序)时遇到问题。我没有收到 ClickOnce 提升提示,如 ScottGu 的 在 WPF 4 上发布

完全信任 XBAP 部署

从 WPF 4 开始,还为 Intranet 和受信任区域中的 XAML 浏览器应用程序 (XBAP) 启用 ClickOnce 提升提示,从而更轻松地部署完全信任的 XBAP。对于需要高于 Intranet 和受信任区域的最低代码访问安全 (CAS) 权限授予集的安全权限的 XBAP,用户在导航到 XBAP 时将能够在 ClickOnce 提升提示上单击“运行”以允许 XBAP以请求的权限运行。

相反,我收到“未授予信任”消息。

我以两种方式运行该应用程序;在这两种情况下,我都会收到“未授予信任”消息。首先,我通过双击本地网络上 NAS 中的 xbap 文件来启动该应用程序。其次,当应用程序通过 IIS 从同一台计算机托管在网站上时,我还尝试启动该应用程序。这两种情况都被认为是从“内部网”运行吗?或者“内联网”在这里有特殊含义吗?或者我做错了什么?

值得注意的是,当我只需从本地计算机双击 xbap 时,我就可以毫无问题地启动该应用程序。

所讨论的 xbap 是专门为了测试 ClickOnce 提升提示而创建的。它是使用 Visual Studio 2010 作为 WPF 浏览器应用程序创建的。我所做的唯一更改是将其更改为完全信任应用程序(“我的项目”>“安全”选项卡>“这是一个完全信任应用程序”)。

在发布向导中,我选择以下选项:

  1. 您想在哪里发布应用程序? - 我选择发布到本地目录
  2. 用户将如何安装该应用程序? - 我选择了“从 CD-ROM 或 DVD-ROM”
  3. 该应用程序是否可以离线使用 - 所有选项均呈灰色

I'm having trouble running a full trust WPF 4 XBAP (browser application), created with Visual Studio 2010, from my intranet. I do not get a ClickOnce elevation prompt, as described in ScottGu's post on WPF 4:

Full Trust XBAP Deployment

Starting in WPF 4, the ClickOnce elevation prompt is also enabled for XAML Browser Applications (XBAPs) in Intranet and Trusted Zones, making it easier to deploy full-trust XBAPs. For XBAPs that require security permissions greater than the minimum code access security (CAS) permission grantset of the Intranet and Trusted Zones, the user will be able to click 'Run' on the ClickOnce elevation prompt when they navigate to the XBAP to allow the XBAP to run with the requested permissions.

Instead, I get the "Trust Not Granted" message.

I'm running the application in two ways; in both cases, I get the "Trust Not Granted" message. First, I'm launching the application by double-clicking on the xbap file from my NAS on the local network. Secondly, I'm also trying to launch the application when it is hosted on a website via IIS from the same machine. Are both of these scenarios considered to be run from an "intranet?" Or does "intranet" mean some in particular here? Or am I doing something completely wrong?

Of note, I am able to launch the application without problem when I simply double-click the xbap from my local computer.

The xbap in question was created specifically to test the ClickOnce elevation prompt. It was created with Visual Studio 2010 as a WPF Browser Application. The only change I made was to change this to a full trust application (My Project > Security tab > This is a full trust application).

In the publish wizard, I am choosing the following:

  1. Where do you want to publish the application? - I chose to publish to a local directory
  2. How will user install the application? - I chose "From a CD-ROM or DVD-ROM"
  3. Will the application be available offline - All choices were grayed out

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

星軌x 2024-09-07 17:18:25

“Intranet”由 Internet 选项中的安全区域设置定义:

本地 Intranet 设置

"Intranet" is defined by your security zones settings in the internet options:

Local intranet settings

我的影子我的梦 2024-09-07 17:18:25

您正在签署部署吗?进入“签名”选项卡并创建一个测试证书(带有密码)并使用它来签署部署。除非经过签名,否则它不会提升为完全信任,因为 XBAP 应用程序来自 Internet 区域。

Are you signing the deployment? Go into the Signing tab and create a test certificate (with a password) and use it to sign the deployment. It won't elevate to full trust unless it's signed because XBAP apps come from the internet zone.

不羁少年 2024-09-07 17:18:25

我在 xbap faq 中读到,发生这种情况是因为浏览器的弹出窗口已关闭。

I read in the xbap faq this happens because popups are turned off for the browser.

踏雪无痕 2024-09-07 17:18:25

或者没有安装.net Framework 4,今天遇到这个问题。它不会警告或显示特定错误,只是未授予信任。

or .net Framework 4 is not installed, had this problem today. It does not warn or show an specific error, just Trust not granted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文