Last Reply on Apr 02, 2013 12:09 AM By Mudassar
Posted on Apr 02, 2013 12:07 AM

Error: 

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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.



Local its run fine. when i place in iis. it throw this exception.

please help me.

Posted on Apr 02, 2013 12:09 AM

It seems to me you are using some DLL and that requires Full Trust.

While your the server where the Application is hosted does not allow full trust. If it is Shared hosting you need to contact the Hosting people and tell them you need Full Trust for your Application

And if it is not a Shared hosting you can edit Web.Config as follows

<system.web>
    <trust level="Full" />
  </system.web>