I am using dotnet template to create template for my azure function using templates.config file. It works fine but unable to create empty folder and throws when it creates solution from this template. I have empty folders in my template and would like to get it copied when we generate code from template. Is there a way that we can do. Below is the image of how it displays as the folder Enums is not generated.
Asked
Active
Viewed 916 times
1 Answers
5
You can create empty folders with the help of placeholder files. The steps are:
Name a placeholder filename in your template.json file
"placeholderFilename": ".keep"
Create your folders and place an empty file named like the value of the previous variable (.keep in the example)

fruggiero
- 943
- 12
- 20
-
Note that the `.keep` file is embedded in the `.nupkg` file if you create a Nuget containing your templates, but it is not created on the disk when you create a new project with your template. – Otiel Jan 13 '22 at 12:56