Using IIS 8 on Windows 8, I configured an application pool that works with the Network Service identifier.
In the code for the page, I call:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Both calls return null.
I tried the <identity impersonate="true|false"/> combinations and also set the Load User Profile parameter to true | false in setting up the application pool, but always get a null result.
I would expect to get one of:
C:\Windows\ServiceProfiles\NetworkService\AppData\Local C:\Windows\System32\config\systemprofile\AppData\Local
On another user computer, they get the second folder as the path (IIS 7.5), although the application pool acts as a Network Service.
What can happen to these profile folders?
source share