How to request permission to read/write to an %AppData% folder in C#?
03:12 08 Nov 2025

I'm trying to be able to read a list of elements (and possibly write to them) from the LocalLow folders where Steam saves some games' data, mostly for the curiosity of it, but I haven't been able to find a way to even request access without "System.UnauthorizedAccessException: Access to the path 'C:\Users\...' " blocking it: I've updated my manifest to include (and tried it with uiAccess="true") but to no avail; here's my code

using System.Diagnostics; //VS22 automatically added this reference during one of my attempts to make this work but I can't remember which it was used for, might not be necessary

class Program
{
    static string gameAddress = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\LocalLow\Owlcat Games"; //... more specific environment locations, just an example
    
    void Main()
    {
    
        Console.WriteLine("check 1")
    
        FileFetch();
    
        Console.WriteLine("check 2")
    
    }
    
    public static async void FileFetch()
    {
        try
        {
            using (FileStream file1 = new FileStream(gameAddress, FileMode.Open, FileAccess.Read))
            {
                using (StreamReader file2 = new StreamReader(file1))
                {
                    string text = await file2.ReadToEndAsync();
       
                    Console.WriteLine(text);
                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }
    }
}

The issue I'm having with this is just getting the permissions to work - accessing the local app data of a program never has these kinds of issues, but trying to fetch a different folder's info is something I can't find any info on.

c# appdata