我已经在 1.0.1.0 和 1.0.4.0 中下载了 recaptcha.dll。尝试呈现控件时,出现以下异常:
安全异常描述:应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请联系您的系统管理员或在配置文件中更改应用程序的信任级别。
异常详细信息:System.Security.SecurityException:请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。
堆栈跟踪:[SecurityException:请求类型'System.Web.AspNetHostingPermission,System,Version = 2.0.0.0,Culture = Neutral,PublicKeyToken = b77a5c561934e089'的权限失败。] System.Reflection.Assembly._GetType(字符串名称,布尔值throwOnError, Boolean ignoreCase) +0 System.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean throwOnError) +209
快速谷歌搜索提供的解决方案是使用 caspol.exe 将完全信任添加到 recaptcha.dll 程序集。
C:\%path%\caspol -af C:\inetpub\wwwroot\%path%\bin\recaptcha.dll
此时,我收到以下错误:
错误:此程序集未签名强名称
除了下载源代码并在本地重新编译之外,还有其他方法可以让它工作吗?