asp.net trust level error
I deployed an asp.net mvc application and everything worked except for my Gallery page that streams pictures using flickr api. I get 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 for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Infor开发者_JAVA百科mation regarding the origin and location of the exception can be identified using the exception stack trace below.
I went into my web.config file and changed
<location allowOverride="true">
<system.web>
<trust level="Full">
And then the site will not run at all, 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.Source Error:
</customErrors>-->
<trust level="Full" />
<pages>
<controls>
The webpage is oneotacycles.com
Any thoughts? Thanks very much!!
As above, it looks like Flickr is trying to make a cache on the server, have you checked that particular folder has write permissions?
This may help, http://flickrnet.codeplex.com/Thread/View.aspx?ThreadId=24550
Inside the constructor for the Flickr class there is a call that tries to load the default settings from the configuration file (i.e. web.config).
If you are running in a restricted security environment (such as a hosted web site with an ISP) then you might not be allowed to put new config sections inside a web.config file so when it parses the file a security exception is thrown. It will do this anytime you create an instance of the Flickr class.
精彩评论