Skip to content
Discussion options

You must be logged in to vote

For the path-string API, I would still create the directory before first use:

Directory.CreateDirectory(appDataPaths.LocalAppData);

Directory.CreateDirectory is idempotent, so it is a cheap way to make the write path robust even if a specific folder has not been materialized yet.

For a closer WinRT-style replacement, check the newer Windows App SDK storage API rather than only AppDataPaths. Microsoft.Windows.Storage.ApplicationData.GetDefault() exposes folder/path properties including local and temporary app data in current SDKs. If your target Windows App SDK version has TemporaryFolder / TemporaryPath, that is the equivalent you are looking for.

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@DrusTheAxe
Comment options

@DrusTheAxe
Comment options

@DrusTheAxe
Comment options

@benstevens48
Comment options

@DrusTheAxe
Comment options

Answer selected by benstevens48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants