Summary
When special folder paths on the HoloLens app that is a UWP app, .NET
developers can use Environment.SpecialFolder
and Windows.Storage
namespace.
- Environment.SpecialFolder Enum (System) | Microsoft Docs
- Windows.Storage Namespace - Windows UWP applications | Microsoft Docs
This post describes the results of actually running the application on HoloLens 2 and logging folder paths. Please note that the results doesn't include reading or writing files from the folder.
Scope
- Environment.SpecialFolder
- Windows.Storage.ApplicationData
- Windows.Storage.KnownFolders
- Windows.Storage.SystemDataPaths
- Windows.Storage.UserDataPaths
Prerequisites
- HoloLens 2 (Windows Holographic v21H2)
- Windows 10 v21H2
- Unity 2020.3.29f1
- Visual Studio 2019 v16.11.10
Path
Environment.SpecialFolder
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.MyVideos)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.CommonPictures)
|
|
Environment.GetFolderPath(Environment.SpecialFolder.CommonVideos)
|
|
Windows.Storage.ApplicationData
Windows.Storage.ApplicationData.Current.LocalCacheFolder.Path
|
|
Windows.Storage.ApplicationData.Current.LocalFolder.Path
|
|
Windows.Storage.ApplicationData.Current.RoamingFolder.Path
|
|
Windows.Storage.ApplicationData.Current.SharedLocalFolder.Path
|
|
Windows.Storage.ApplicationData.Current.TemporaryFolder.Path
|
|
Windows.Storage.KnownFolders
Windows.Storage.KnownFolders.AppCaptures.Path
Required Video Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.CameraRoll.Path
Required Picture Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.DocumentsLibrary.Path
Required Documents Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.HomeGroup.Path
|
|
Windows.Storage.KnownFolders.Objects3D.Path
Required 3D Object capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.PicturesLibrary.Path
Required Picture Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.SavedPictures.Path
Required Picture Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.KnownFolders.VideosLibrary.Path
Required Video Library capability, if it isn't you will get
Attempted to perform an unauthorized operation.
|
|
Windows.Storage.SystemDataPaths
Windows.Storage.SystemDataPaths.GetDefault().Public
|
|
Windows.Storage.SystemDataPaths.GetDefault().PublicDocuments
|
|
Windows.Storage.SystemDataPaths.GetDefault().PublicDownloads
|
|
Windows.Storage.SystemDataPaths.GetDefault().PublicPictures
|
|
Windows.Storage.SystemDataPaths.GetDefault().PublicVideos
|
|
Windows.Storage.UserDataPaths
Windows.Storage.UserDataPaths.GetDefault().CameraRoll
|
|
Windows.Storage.UserDataPaths.GetDefault().Documents
|
|
Windows.Storage.UserDataPaths.GetDefault().Downloads
|
|
Windows.Storage.UserDataPaths.GetDefault().LocalAppData
|
|
Windows.Storage.UserDataPaths.GetDefault().LocalAppDataLow
|
|
Windows.Storage.UserDataPaths.GetDefault().Pictures
|
|
Windows.Storage.UserDataPaths.GetDefault().RoamingAppData
|
|
Windows.Storage.UserDataPaths.GetDefault().SavedPictures
|
|
Windows.Storage.UserDataPaths.GetDefault().Screenshots
|
|
Windows.Storage.UserDataPaths.GetDefault().Videos
|
|
Other
Path.GetTempPath()
|
|
System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
References
- Environment.SpecialFolder Enum (System) | Microsoft Docs
- Windows.Storage Namespace - Windows UWP applications | Microsoft Docs
- ApplicationData Class (Windows.Storage) - Windows UWP applications | Microsoft Docs
- KnownFolders Class (Windows.Storage) - Windows UWP applications | Microsoft Docs
- SystemDataPaths Class (Windows.Storage) - Windows UWP applications | Microsoft Docs
- UserDataPaths Class (Windows.Storage) - Windows UWP applications | Microsoft Docs
- App capability declarations - UWP applications | Microsoft Docs