How to create element templates in Visual Studio 2017

How to create element templates in Visual Studio 2017. In VS 2015, the "Export Template" element appeared from the File menu, from which projects or elements can be created. Is this feature available or just moved? THX

+8
visual-studio-2017
source share
4 answers

I found creation item templates in Visual Studio 2017 in the Projects menu. And I can export the elements and import them into other projects.

+3
source share

As indicated by Guru Stron above, the template will be exported to the "C: \ Users \ [UserName] \ Documents \ Visual Studio 2017 \ My Exported Templates] folder as a zip file. To use this template, you will have to move or copy it to the following folder ... C: \ Users \ [UserName] \ Documents \ Visual Studio 2017 \ Templates \ ProjectTemplates In addition, if you want to additionally determine where your template appears in the New Projects dialog box, you will need to delve into the path.

For example, if you have a .NET kernel template written in C #, you need to put your template in this path ... C: \ Users \ [UserName] \ Documents \ Visual Studio 2017 \ Templates \ ProjectTemplates \ Visual C # \ .NET Core Of course, you may need to add the last folder (.NET Core).

The most interesting thing is that you can create a collection of templates for your own organization, you can place templates in a path such as ... C: \ Users \ [UserName] \ Documents \ Visual Studio 2017 \ Templates \ ProjectTemplates \ Visual C # \ Daffitt Technologies \ .NET Core. It will look something like this:

Custom Template Example

It should be noted that there may be other tweaks that you should do with the files contained in the zip file, in particular with the file MyTemplate.vstemplate. I noticed that the created project templates do not always produce the expected results.

+3
source share

it moved to the project menu, but I exported several things, and none of them appeared, figured out how to make it work.

+2
source share

As indicated in other answers, the option is in the Project menu. The documentation for this is now located at https://docs.microsoft.com/en-gb/visualstudio/ide/how-to-create-item-templates

+1
source share

All Articles