Skip to content

Commit 5dd215d

Browse files
authored
AppDataPaths::LocalAppData throws, not Get*
This code when run in an unpackaged app (say, a test environment) succeeds and returns an AppDataPaths instance, but the app-specific properties fail. ```c++ std::filesystem::path GetApplicationData(winrt::Windows::System::User user) { auto paths = user ? winrt::Windows::Storage::AppDataPaths::GetForUser(user) : winrt::Windows::Storage::AppDataPaths::GetDefault(); return std::wstring_view{ paths.LocalAppData().c_str() }; } ``` Updated the remarks to match the behavior.
1 parent 1773497 commit 5dd215d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

windows.storage/appdatapaths.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ AppDataPaths returns paths to commonly used application folders based on the [KN
1515
## -remarks
1616
This class returns paths that are always isolated per the caller’s context. For example, this will match expectations of cross-platform app developers who might have used “private” versions of documents in the past. There is no legacy COM interop interface for this type.
1717

18-
Requesting folder locations from an app that doesn’t have a package identity will fail (for example, [GetDefault](appdatapaths_getdefault_846721868.md) and [GetForUser](appdatapaths_getforuser_2058550280.md) will both return null). This ensures there are no migration issues if an app depends on the per-app locations being shared (Win32), or if the app paths change when using the Desktop Bridge.
18+
Requesting app-specific folder locations from a an app without package identity (for example, [LocalAppData](appdatapaths_localappdata.md)) will fail. This ensures there are no migration issues if an app depends on the per-app locations being shared (Win32), or if the app paths change when using the Desktop Bridge.
1919

2020
## -see-also
2121

0 commit comments

Comments
 (0)