I have web application that have to access local resources, files/folders, to be able to do git clone/pull/push. I’ve created a separate Application Pool with Process Identity == my own account (Administrator of machine).
But, if I do:
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
The return value:
"C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local"
so, it looks like system profile is still used. git clone and other git operations hangs up, seems like fail to find .ssh keys etc.
The interesting thing, that it worked fine before Windows SP1 update (at least I blame update, since nothing more changed on machine).
If already not having it, try setting:
in web.config
EDIT
I was wrong, you need to have your app pool identity with access to local folder here:
EDIT 2
I have found solution. To run application AS you, you need to turn on impersonation after all (app pool setting does not apply on my IIS7.5), but AS A SPECIFIC USER. So, to enable this, you need to turn impersonation on in web.config AND specify user:
You can also set this through inetmgr:

Either way, after setting this,
gives:
Another update:
I have been searching for a way to do the same without putting my password in web.config, and can confirm that I get local user folder also when basic impersonation is on
But under condition that application connects (under app settings -> Connect as…) as me: