Add Maui FileSystem LayoutRenderer

Open
#2 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start by reading the existing Special Folder Layout Renderer and the linked .NET MAUI file-system helper documentation. Implement a Maui FileSystem LayoutRenderer that resolves CacheDirectory and AppDataDirectory on MAUI, with AppContext.BaseDirectory for .NET Standard and other platforms; done means these paths are returned correctly.

Written by the indexing model from the issue text.

Description

Cache directory (Returns the LocalCacheFolder directory)

FileSystem.Current.CacheDirectory;

C:/Users/{MyName}/AppData/Local/Packages/{GUID}_{hash}/LocalCache/

App data directory (Returns the LocalFolder directory that is backed up to the cloud)

FileSystem.Current.AppDataDirectory;

C:/Users/{MyName}/AppData/Local/Packages/{GUID}_{hash}/LocalState/

For NetStandard (and others) then it can just return:

System.AppContext.BaseDirectory

https://docs.microsoft.com/en-us/dotnet/maui/platform-integration/storage/file-system-helpers?tabs=windows

Notice MAUI performs virtualization so when resolving SpecialFolder.LocalApplicationData then it automatically redirect to custom folder:

C:/Users/{MyName}/AppData/Local/Packages/{GUID}_{hash}/LocalCache/

Dominant language
C#
Stars
20
Forks
4
Avg merge
16h 40m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NLog/NLog.Targets.MauiLog

All issues in NLog/NLog.Targets.MauiLog

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.