ASP.NET - Security exception.

Asked By Khubruy Mehta on 01-Oct-10 01:45 AM
hi,

I have uploaded my asp.net web application on godaddy.com.
When im trying to run a certain .aspx page im getting the following 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 failed.

Please help...

Khubruy Mehta
Sagar P replied to Khubruy Mehta on 01-Oct-10 05:06 AM
Change the trust level in config file like;

<system.web>
  <securityPolicy>
    <trustLevel name="Full" policyFile="internal"/>
  </securityPolicy>
</system.web>

http://msdn.microsoft.com/en-us/library/wyts434y.aspx
Khubruy Mehta replied to Sagar P on 01-Oct-10 05:12 AM
hi,

If i put the above code in my config file i get the following error.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.



Please help.
Thanks
Khubruy Mehta
Sagar P replied to Khubruy Mehta on 01-Oct-10 05:22 AM
Your host has set the trust level value in machine.config, and set it to not allow overrides, this is normal reason for this error when u make trust level full.

Try one thing remove that full trust and follow these steps mentioned in this link to give full trust;

http://support.microsoft.com/kb/320268