Get appdata\local folder path in C# windows service
c#, windows-services
Solution
Are you running the service under a user account? If not, the service will use its own profile as you see. If this service is "logged into" by a user, then you could pass the folder to the service and bypass local checking. Otherwise, try running the service under a user account (or create an account for it).
Problem
I am try to get `C:\Users\<username>\AppData\Local` folder path using ``` Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) ``` in a C# Windows service, but it returns some other path ``` C:\Windows\ServiceProfiles\LocalService\AppData\Local ``` Does any have any idea how to do it correctly?