I am developing ASP.Net project (framework 2.0) on local machine (Windows 7). IIS 7.5 is the local webserver.
When I run the project locally Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)
returns empty string.
I am a bit sheepish and frustrated since I encountered this issue when I setup this new dev machine, but cannot remember the solution and cannot find solution by Googling. Others on the dev team running XP do not encounter this problem.
I am expecting a return of C:\Users\DefaultAppPool\AppData\Local\Microsoft\Windows\Temporary Internet Files
.
Not sure if this a iis setting issue or can I set the environment variable somewhere.
Thanks, Jeff
I'm 99% sure this is going to come down to a permissions issue. In IIS7, there is a new "user" called AppPoolIdentity that is the default identity for an app pool. This user has much lower permissions than the defaults in IIS 6.
I can reproduce your issue, I have to set my AppPool to run as either LocalSystem or a specific user with administrative rights to retrieve Environment.SpecialFolder.InternetCache which makes sense when I look at the folder in question and view it's permissions.
Be aware, there are security issues with running IIS app pools with higher permissions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With