tenho seguinte código blazor

@page "/ProgressBar"

@inject HttpClient HttpClient
@inject IJSRuntime JsRuntime

@using System.IO
@using System.Security.Cryptography
@using NLua

<div class="absolute bottom-3 rounded-lg w-[71%] h-[8%] flex flex-col justify-between items-center">
    <p class="text-[14px] font-bold text-opacity-[0.95] text-white text-center">
        @statusMessage
        <span class="text-[#d16b2b] px-2 py-1 rounded"> @currentFileName </span>
        (<span class="text-[#38D12B] text-opacity-[0.95]">
            @FormatBytes(downloadedBytes)
        </span> / @FormatBytes(totalBytes))
    </p>

    <div class="w-[95%] bg-[#0E1622]/[0.95] rounded-md h-5 flex items-center">
        <div class="bg-[#1164CA]/[0.95] ml-1 rounded-md h-4 transition-all duration-300" style="width: @(progressPercent)%"></div>
    </div>
</div>

@code {
    private List<FilePatch> filesToDownload = new();
    private string statusMessage = "Conectando ao servidor...";
    private double progressPercent = 0;
    private string downloadUrl = "https://hil-speed.hetzner.com";
    private string baseDirectory = "C:/Users/jonatas/Desktop/Megasantos/RagnaTales/src-tauri/target/debug";
    private string? currentFileName = null;
    private long downloadedBytes = 0;
    private long totalBytes = 0;

    protected override async Task OnInitializedAsync()
    {
        //baseDirectory = AppContext.BaseDirectory;
        string patchFolder = Path.Combine(baseDirectory, "patch");
    
        if (!Directory.Exists(patchFolder))
        {
            Directory.CreateDirectory(patchFolder);
        }

        await LoadPatchFile();
        await DownloadFiles();
    }

    private async Task LoadPatchFile()
    {
        string patchFilePath = Path.Combine(baseDirectory, "patch.lua");

        if (!File.Exists(patchFilePath))
        {
            statusMessage = "Erro: Arquivo patch.lua não encontrado.";
            return;
        }

        try
        {
            string luaContent = await File.ReadAllTextAsync(patchFilePath);
            filesToDownload = ParseLuaToPatchList(luaContent);
            statusMessage = "Preparando para iniciar o download...";
        }
        catch (Exception ex)
        {
            statusMessage = $"Erro ao carregar patch.lua: {ex.Message}";
        }
    }

    private async Task DownloadFiles()
    {
        foreach (var file in filesToDownload)
        {
            currentFileName = file.FileName;

            if (file.FileName == null)
            {
                statusMessage = "Erro: Nome do arquivo ausente, pulando download...";
                continue;
            }

            string localFilePath = Path.Combine(Path.Combine(baseDirectory, "patch"), file.FileName);

            if (File.Exists(localFilePath) && CheckFileIntegrity(localFilePath, file.Integrity))
            {
                statusMessage = $"O arquivo {file.FileName} já existe, pulando download...";
                continue;
            }

            bool downloadSuccess = false;
            int retryCount = 0;
            while (!downloadSuccess && retryCount < 3)
            {
                try
                {
                    statusMessage = $"Baixando {file.FileName}...";
                    await DownloadFile(file.FileName, localFilePath);
                    downloadSuccess = true;
                    statusMessage = $"Download de {file.FileName} concluído!";
                }
                catch (HttpRequestException ex) when (ex.Message.Contains("404"))
                {
                    statusMessage = $"Erro: Arquivo {file.FileName} não encontrado (404), saltando em 5 segundos...";
                    await Task.Delay(5000);
                    break;
                }
                catch
                {
                    retryCount++;
                    statusMessage = "Erro ao conectar, reiniciando download...";
                    await Task.Delay(3000);
                }
            }
        }
    }

    private async Task DownloadFile(string fileName, string localFilePath)
    {
        var url = $"{downloadUrl}/{fileName}";

        using var response = await HttpClient.GetAsync(url, HttpCompletionOption.ResponseHeadersRead);

        if (!response.IsSuccessStatusCode)
        {
            throw new HttpRequestException($"Erro ao baixar o arquivo {fileName}: {response.StatusCode}");
        }

        using var contentStream = await response.Content.ReadAsStreamAsync();
        using var fileStream = new FileStream(localFilePath, FileMode.Create, FileAccess.Write, FileShare.None, 8192, true);

        totalBytes = response.Content.Headers.ContentLength ?? -1L;
        downloadedBytes = 0;
        var buffer = new byte[8192];
        int read;

        while ((read = await contentStream.ReadAsync(buffer.AsMemory(0, buffer.Length))) > 0)
        {
            await fileStream.WriteAsync(buffer.AsMemory(0, read));
            downloadedBytes += read;

            if (totalBytes > 0)
            {
                progressPercent = (double)downloadedBytes / totalBytes * 100;
                StateHasChanged();
            }
        }
    }

    private bool CheckFileIntegrity(string filePath, string? expectedHash)
    {
        if (expectedHash == null) return true;

        using var sha1 = SHA1.Create();
        using var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
        var hashBytes = sha1.ComputeHash(fileStream);
        var fileHash = BitConverter.ToString(hashBytes).Replace("-", "").ToLowerInvariant();
        return fileHash == expectedHash;
    }

    private List<FilePatch> ParseLuaToPatchList(string luaContent)
    {
        var files = new List<FilePatch>();

        using var lua = new Lua();
        lua.DoString(luaContent);

        LuaTable updatesTable = lua.GetTable("updates");

        foreach (LuaTable update in updatesTable.Values)
        {
            var filePatch = new FilePatch
            {
                Version = Convert.ToInt32(update["Version"]),
                FileName = update["FileName"] as string ?? string.Empty,
                Integrity = update["Integrity"] as string ?? string.Empty
            };
            files.Add(filePatch);
        }

        return files;
    }

    private string FormatBytes(long bytes)
    {
      if (bytes == 0)
        return "0 B";

      string[] sizes = { "B", "KB", "MB", "GB", "TB" };
      int order = (int)Math.Floor(Math.Log(bytes, 1024));
      double len = bytes / Math.Pow(1024, order);

      return string.Format("{0:0.##} {1}", len, sizes[order]);
  }


    public class FilePatch
    {
        public int Version { get; set; }
        public string? FileName { get; set; }
        public string? Integrity { get; set; }
    }
}

código não está conseguindo criar a pasta patch, não está conseguindo ler o arquivo patch.lua, e o caminho está correto