• 主页
  • ASP
  • .NET Framework
  • Web Services
  • VB
  • VC
  • 图表区
  • 分析与设计
  • 组件/控件开发
  • LINQ
zenoven 2010年12月21日
ASP.NET在Medium Trust Level下面的问题
我也是最近才知道Trust Level的问题,所以很菜,现在遇到了两个问题,服务器的 Trust Level是改不了的,现在怎么能解决这两个问题呢?谢谢大家了!

1、一个验证码控件在Medium Trust Level下面不能运行,控件是dll的,
Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Source Error:


Line 135: <label>
Line 136: <span class="span" style="float:left;width:153px;">验证码</span>
Line 137: <cc1:AuthCode ID="AuthCode1" runat="server" CssClass="authcode" Height="20px" TextBoxClass="input" TextControlWidth="120px" Width="294px" EnableClientValidate="True" SubmitControlID="submit" IsChangeImageOnPostback="True" />
Line 138: </label>
Line 139: <p>

运行错误截图如下,截图红色那一部分就是用的控件


2、程序对web.config有写操作,但是现在不能执行了,我想大概也是这个。

错误信息如下
Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

...全文
103 点赞 收藏 1
写回复
1 条回复

还没有回复,快来抢沙发~

发动态
发帖子
.NET技术社区
创建于2007-09-28

4.8w+

社区成员

66.8w+

社区内容

.NET技术交流专区
社区公告
暂无公告