Исключение безопасности в 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.

person DanielXu    schedule 01.08.2013    source источник
comment
Это похоже на то, как вы должны исправить этот ... глупый вопрос, но вы устанавливаете его где-нибудь еще в своем web.config? Единственное, что я могу думать, это то, что вы перезаписываете его.   -  person Gray    schedule 01.08.2013


Ответы (1)


При отправке электронной почты вы можете указать номер порта SMTP, который может быть запрещен.

Вот пример того, о чем я говорю: SecurityException: Запрос разрешения типа "System.Net.Mail.SmtpPermission"

person Cloud SME    schedule 01.08.2013