0

I have a WCF service deployed on a local server. The source code needs to access to the %LocalAppData% environment variable but when I try to access to that folder on C# using the following line of code:

Environment.SpecialFolder.LocalApplicationData

It refers to the following Path:

C:\Windows\system32\config\systemprofile\AppData\Local\

Any idea why this could be happening? If I login into the local server and I go to %localappdata% it refers to the right path... Maybe there is something on the IIS server I need to change? Any pointers?

Thanks!

user3587624
  • 1,427
  • 5
  • 29
  • 60
  • 1
    What user context is your app running under? Probably a result of running with UAC elevated privileges. – CodingGorilla Apr 05 '16 at 17:24
  • I googled it and came up with this: http://superuser.com/questions/598601/what-is-system32-config-systemprofile – rory.ap Apr 05 '16 at 17:24
  • The Site under IIS is using an Application Pool that has my own credentials on it (my Identity basically). I took a look to that link and to me it is not clear whether or not I would be able to change that directory folder. Would that be possible? – user3587624 Apr 05 '16 at 17:30
  • I found a solution on following thread! http://stackoverflow.com/questions/9490107/iis-7-5-application-pool-uses-wrong-appdata-for-custom-user-as-identity – user3587624 Apr 05 '16 at 18:22

0 Answers0