Security Policy 问题解析
来源:互联网 发布:华美网络 编辑:程序博客网 时间:2024/06/05 04:12
最近,博主在发布网站的时候遇到一个新情况,系统发布完成后上传到服务器连接不上数据库,报出“Security Policy” 错误 “System.Security.SecurityException: That assembly does not allow partially trusted callers.” 。经查证。发现是客户服务器设置了较高的安全策略,系统代码中并没有给.dll 文件设置相应的访问安全设置,造成页面在服务器上无法访问dll文件。
修改方法:
将系统中的每个类库的 AssemblyInfo.cs 中添加以下代码:
using System.Security;[assembly: AllowPartiallyTrustedCallers()]
然后编译发布就可以了!
建议技术人员发布网站的时候,如果无法再服务器的IIS上浏览查询网站错误,可以将web.config的自定义错误跳转关闭,如下:
<customErrors defaultRedirect="Error.aspx" mode="Off"/>这样在客户端就可以查询到服务器端反馈的错误。方便解决问题,避免麻烦产生!
- Security Policy 问题解析
- Security policy in .Net
- Content Security Policy
- Content Security Policy介绍
- Content Security Policy介绍
- java 配置security policy
- Same-origin security policy
- Content Security Policy介绍
- Content Security Policy 入门教程
- Privacy Policy:Mobile Security
- Content Security Policy 介绍
- chrome textension Content Security Policy
- JAVA.SECURITY.POLICY 配置说明
- 问题人生[20160112] the App Transport Security policy requires the use of a secure connection
- 修改App Transport Security policy requires the use of a secure connection问题
- 升级IOS 9 和 XCode 7 引起的问题64位的问题 App Transport Security Policy
- Managing .NET Code Access Security (CAS) Policy
- Web Parts, Impersonate and Security Policy
- linux下的头文件和库文件搜索路径
- selenium-webdriver——如何在启动firefox时加载扩展
- 搜索引擎算法研究专题六:HITS算法
- 搜索引擎算法研究专题五:TF-IDF详解
- richeidt 控件開發(八)
- Security Policy 问题解析
- linux操作系统中内存buffer和cashed
- Cayley n顶点树数定理
- 搜索引擎算法研究专题七:Hilltop算法
- 在Windows环境下利用repo下载Android源代码
- 搜索引擎算法研究专题八:TrustRank算法
- Unity学习笔记——MonoBehaviour类Invoke, Coroutine
- LINK : warning LNK4075: 忽略”/EDITANDCONTINUE”(由于”/INCREMENTAL:NO”规范)
- malloc函数的一种简单的原理性实现[转]