I am facing an Security Exception issue.
I am trying to export an pdf file but I am getting this error:
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: That assembly
does not allow partially trusted callers.
Now I am changing the web.config file by setting ASP.NET hosting trust level
but still it is not working:I am getting this Parser error:
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.
This the code I am adding in web.config file:
<location allowOverride="true">
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal" />
</securityPolicy>
<trust level="Full" originUrl="" />
</system.web>
</location>
And I have also tried with these trust level one by one:
<trustLevel name="High" policyFile="web_hightrust.config" />
<trustLevel name="Medium" policyFile="web_mediumtrust.config" />
<trustLevel name="Low" policyFile="web_lowtrust.config" />
<trustLevel name="Minimal" policyFile="web_minimaltrust.config" />
<trustLevel name="Custom" policyFile="web_CustomTrust.config" />
But still it is not working
Please can help fixing this.By the way I am hosted in Godaddy.