【发布时间】:2013-08-01 14:56:21
【问题描述】:
您好,我在会员申请中实现“向会员发送电子邮件”功能时遇到了以下问题。我做了一些研究并添加了
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
</system.web>
到我的Web.config,然后再次部署到服务器,但问题仍然存在。有任何想法吗?提前致谢。
Server Error in '/TestApp' Application.
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.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
【问题讨论】:
-
这似乎是你应该如何解决这个问题......愚蠢的问题,但你是否在 web.config 中的其他任何地方设置它?我唯一能想到的是你正在覆盖它。
标签: asp.net-mvc-3 security code-access-security asp.net-mvc-3-areas