Error accessing folder from ASP application

Discussion in 'Site Programming, Development and Design' started by MichaelP, Apr 26, 2011.

  1. Here is my situation:

    I have a folder as a sub of the site root called MyApp, which is an application folder in IIS. This is the entry point URL of my application. I also have a folder of the site root called Images, so the layout is:

    Site root-------Myapp
    |
    |---Images​
    I get an access error when i try to save an image from within my application to the Images folder. Can the be done, or do I have to change my folder structure? Thanks in advance for any pointers.
     
  2. Ray

    Ray

    Whats the full exact error? How did you deploy our website?
     
  3. Here is the full 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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    I deployed as a website using ftp in VS.

    Btw, i havent ruled out a possible coding error, although it does work with on local server with this structure.
     
  4. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  5. Thx Ray,

    I explicitly set the trust level to "High" in the config file and it worked perfectly.

    I HAD considered that as an issue before posting but MS states here that the default is "Full", so i dismissed it too quickly :)

    Thanks again for the quick resolution
     

Share This Page