I have an Asp.net app that simply reads an xml file and this code used to work fine on Vista with VS2008, now I just moved to Windows 7 and I migrated the code to VS2010, I encoutered “Access to the path [path to my webapp folder] is denied". Nothing else is changed, I tried to change folder perms even though I didn't think it got anything to do with that since the same code used to work fine, but still didn't get around this problem.
Could someone please shed some light on why this may be happening and how to fix it?
Thanks, Ray.
The Visual Studio built-in webserver runs in a partial-trust security sandbox, which has restricted permissions on specific files and paths. Somehow the path and/or file you are trying to access are outside the sandbox's permissions.
You could try to set the security level of the webserver sandbox to full trust by adding or modifying this in your web.config:
<system.web>
<trust level="Full" />
</system.web>
Please note that this should not be used on a live server. In that case, you should set the correct permissions both in IIS and using folder permissions.