Common errors associated with inadequate Trust Level

Programming, error messages and sample code > ASP.NET
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.

---

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

---

Stack Trace:
[SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]

---

Error:
Request for the permission of: type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

---

Unable to connect to any of the specified MySQL hosts. ---> System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System,

---

Error:
Request for the permission of type
'System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.

---
If your application generates any of the above error messages, the most likely cause is that your application requires a higher trust level than "Medium"

You can override the default trust level of in your application by modifying the web.config file.  See this Knowledge Base article for detailed instructions.