Moving From ASP.NET 3.5 to 4.0 - Can't Access FileSystem Anymore

Discussion in 'Site Programming, Development and Design' started by RobDude, May 16, 2011.

  1. 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 had a pretty simple page that would read and write to a text file. When switched my site from 3.5 to 4.0 - it stopped working...and I can't seem to figure it out.

    Has anyone run into this before? I had to modify the web.config file to get it working on 3.5 - but no luck in 4.0.
     
  2. Change your trust level in your web.config to full:

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

Share This Page