1

我已经设置了一个在网页上运行的 activex 控件。服务器可以为自己提供这个网页,但内网和互联网上的其他机器无法访问它。

Caspol 设置如下所示:

代码组:

1.  All code: FullTrust
   1.1.  Zone - MyComputer: FullTrust
      1.1.1.  StrongName - (omitted) : FullTrust
      1.1.2.  StrongName - 00000000000000000400000000000000: FullTrust
   1.2.  Zone - Intranet: FullTrust
      1.2.1.  All code: Same site Web
      1.2.2.  All code: Same directory FileIO - 'Read, PathDiscovery'
   1.3.  Zone - Internet: Internet
      1.3.1.  All code: Same site Web
   1.4.  Zone - Untrusted: Nothing
   1.5.  Zone - Trusted: Internet
      1.5.1.  All code: Same site Web
   1.6.  Url - http://MYSERVERNAME/APPLICATIONNAME/*: FullTrust
Success

我试图访问的应用程序是组 1.6。我在这里做错了吗?

[编辑] 值得一提的是,试图从 Intranet 访问控件的机器上的 IEDebug 错误日志显示一个长异常。其中最值得一提的是:

System.Net.WebPermission
The first permission that failed was:
<IPermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1">
4

2 回答 2

4

很久以前,我在某处读到 .Net 用户控件,Url 证据不起作用。只有站点和区域证据有效。

caspol -machine -quiet -addgroup Trusted_Zone -site mysite.com FullTrust -name mysite -description "Code group granting trust to code from mysite.com"

您可以为每个区域执行此操作。

使用 IE8 时,请确保将 mysite.com 添加到受信任的站点列表3中。我不确定保护模式是否必须关闭。

当您在 64 位系统上时,有两个 caspol,具有不同的权限:

  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\caspol.exe
  • C:\Windows\Microsoft.NET\Framework64\v2.0.50727\caspol.exe

我花了很多时间在 32 位 caspol 上设置权限,然后将我的头撞到墙上,因为它不起作用。原来我使用了 64 位 IE8,因为它生成了 IEDebug.log。最好在两个版本上设置权限。

于 2009-08-10T05:36:57.383 回答
0

事实证明,这根本不是信任问题。应用程序运行所需的 DLL 不在应用程序的 bin 目录中。因此,应用程序试图从 GAC 中提取所需的 DLL,这是不正确的。使用所需的 DLL 进行部署解决了该问题。

作为旁注——这是一种非常陈旧的软件交付机制,希望它不再被使用。调试这些类型的错误比它应该的要困难得多。建议选择比嵌入式控件更好的交付机制。

于 2013-02-04T15:19:37.843 回答