1

嗨我在會員應用程序中實現「向成員發送電子郵件」功能時遇到以下問題。我做了一些研究,並添加MVC3中的安全異常

   <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. 
+0

這似乎是你應該如何解決這個問題?愚蠢的問題,但你在web.config中設置任何其他地方?唯一我能想到的就是你正在覆蓋它。 – Gray

回答