-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Special Folder Layout Renderer
Rolf Kristensen edited this page Nov 8, 2023
·
15 revisions
System special folder path (includes My Documents, My Music, Program Files, Desktop, and more).
Platforms Supported: Limited (Not supported on NetStandard1.3+1.5)
See also ${processdir} , ${basedir} , ${currentdir} , ${tempdir}
${specialfolder:dir=String:file=String:folder=Enum}
Example using CommonApplicationData
which is good when running as Windows Service:
-
fileName="${specialfolder:folder=CommonApplicationData:cached=true}/AppName/logfile.txt"
- Windows-Path -
C:/ProgramData/AppName/logfile.txt
- Windows-Path -
- dir - Name of the directory to be Path.Combine()'d with the directory name.
- file - Name of the file to be Path.Combine()'d with the directory name.
-
folder - System special folder to use. Full list of options is available at MSDN. The most common ones are:
-
ApplicationData - Roaming application data for current user
- Windows Path =
C:\Users\%USERNAME%\AppData\Roaming
- Xamarin Mono =
$HOME/.config
(or $XDG_CONFIG_HOME if set) - Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@/Documents/.config
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files/.config
- Windows Path =
-
LocalApplicationData - Non roaming application data for current user
- Windows Path =
C:\Users\%USERNAME%\AppData\Local
- Xamarin Mono =
$HOME/.local/share
(or $XDG_DATA_HOME if set) - Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@/Documents
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files/.local/share
- Windows Path =
-
CommonApplicationData - Application data for all users (Good when running as Windows Service)
- Windows Path =
C:\ProgramData
- Xamarin Mono =
/usr/share
- Xamarin iOS =
/usr/share
- Xamarin Android =
/usr/share
- Windows Path =
-
MyDocuments - My Documents
- Windows Path =
C:\Users\%USERNAME%\Documents
- Xamarin Mono =
$HOME
- Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@/Documents
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files
- Windows Path =
-
Desktop - My Desktop
- Windows Path =
C:\Users\%USERNAME%\Desktop
- Xamarin Mono =
$HOME/Desktop
(or $XDG_DESKTOP_DIR if set) - Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@/Documents/Desktop
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files/Desktop
- Windows Path =
-
UserProfile
- Windows Path =
C:\Users\%USERNAME%
- Xamarin Mono =
$HOME
- Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files
- Windows Path =
-
Templates
- Windows Path =
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Templates
- Xamarin Mono =
$HOME/Templates
(or $XDG_TEMPLATES_DIR if set) - Xamarin iOS =
/data/Containers/Data/Application/@GENERATED_NAME@/Documents/Templates
- Xamarin Android =
/data/data/@PACKAGE_NAME@/files/Templates
- Windows Path =
-
CommonTemplates
- Windows Path =
C:\ProgramData\Microsoft\Windows\Templates
- Xamarin Mono =
/usr/share/templates
- Xamarin iOS =
/usr/share/templates
- Xamarin Android =
/usr/share/templates
- Windows Path =
-
Resources
- Windows Path =
C:\WINDOWS\resources
- Xamarin iOS =
/Library
- Windows Path =
- AdminTools
- CommonAdminTools
- CommonDesktopDirectory
- CommonDocuments
- CommonMusic
- CommonPictures
- CommonProgramFiles
- CommonProgramFilesX86
- CommonPrograms
- CommonStartMenu
- CommonStartup
- CommonVideos
- Cookies
- DesktopDirectory (Same as Desktop)
- Favorites
- Fonts
- History
- LocalizedResources
- MyComputer
- MyMusic
- MyPictures
- MyVideos
- NetworkShortcuts
- Personal (Same as MyDocuments)
- PrinterShortcuts
- ProgramFiles
- ProgramFilesX86
- Programs
- Recent
- SendTo
- StartMenu
- Startup
- System
- SystemX86
- Windows
-
ApplicationData - Roaming application data for current user
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json