JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

File template variables

Last modified: 08 October 2024

A file template can contain variables, which are replaced by their values when the template is applied. A variable is a string that starts with a dollar sign $ followed by the variable name. The variable name may optionally be enclosed in curly braces. For example: $MyVariable and ${MyVariable} are different notations of the same variable.

Predefined and custom variables are available in the template body and in the filename. For example, if you type MyFile_${MONTH_NAME_FULL} in the File name field of your template, the resulting file will be named MyFile_April if you create it in April. Here, ${MONTH_NAME_FULL} is a predefined variable. If you use a custom variable instead, JetBrains Rider will prompt you to enter the variable value when you create a file based on this template.