如何在Intranet上运行完全信任XBAP? [英] How do I run a Full Trust XBAP on intranet?
问题描述
我已经制作了一个WPF浏览器应用程序,该应用程序承载着旧的WinForms控件(我尚未完全迁移到WPF).使用WindowsFormsHost意味着我的浏览器应用程序需要完全信任才能运行.这对我来说不是问题,因为此应用程序仅应在我公司的Intranet上运行.但是,在将xbap部署到网络共享后,它拒绝运行,并说未授予信任".
I've made a WPF Browser Application that hosts old WinForms controls (I haven't migrated fully to WPF yet). Using WindowsFormsHost means my Browser App requires Full Trust to run. This is not a problem for me since this app is only meant to be run on the intranet at my company. However, after I deploy the xbap to a network share, it refuses to run, saying "Trust not granted".
我可以使用哪些方法为公司内部网上存储的XBAP应用程序授予完全信任"?
What are the methods I can use to grant Full Trust to XBAP applications stored on my companies intranet?
推荐答案
到目前为止,我已经找到了两种方法来做到这一点.通过在目标计算机上安装证书.
So far, I've found 2 ways to do this. Through a really complicated method of installing certificates on the target machine.
Or through a simpler method, which is only suitable for intranets here:
部署自定义CLR安全策略 修改默认值 给定区域的权限集
Deploy a custom CLR Security policy that modifies the default permissionset for the given zone
所以我只是这样做了,而且行得通.这是我如何使其工作的详细步骤:
So I did just that, and it works. Here's the detailed steps how I got it to work:
- 打开控制面板>管理工具> .NET Framework 2.0配置
- 展开运行时安全策略>机器>代码组> All_Code
- 右键单击"All_Code",然后单击新建".
- 创建一个新的代码组,我将其命名为MyProject_FullTrust_Zone
- 选择URL条件类型,并指定将在其中部署应用程序的网络上的路径.
- 选择使用现有"权限集,并将其设置为完全信任".
现在这种方法的唯一问题是,我必须将此更改部署到数百台计算机上.所以也许还有更简单的方法可以做到这一点?
Now the only problem with this method, is that I have to deploy this change to hundreds of machines. So maybe there's still a simpler way to do this?
这篇关于如何在Intranet上运行完全信任XBAP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!