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

Create multi-file templates

Last modified: 11 February 2024

A file template can create more than one file when you apply the template. This may be helpful when related data is saved in different files.

Here are a few things you need to know about multi-file templates:

  • A file template always include one main file, and, optionally, any number of secondary files. So as soon as you add a secondary file to any file template you get a multi-file template.

  • When adding a secondary file, you can reference any existing file template (Add file from existing template option). Note that if the referenced template has multiple files too, then only the main file of the referenced template will be added when you apply the template.

  • The set of parameters spans all files of a multi-file template. That is, if you use the same parameter $PARAM$ in several files of a multi-file template, it will have the same value in all related files when the template is applied.

  • If a multi-file templates has editable parameters, the Hot spot session, which deploys when you apply this template, will guide you through all created files where the user input is required.

This feature is supported in the following languages and technologies:

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the Languages and frameworks section.