How to: Create Item Templates in Visual Studio 2017

前端 未结 4 1374
陌清茗
陌清茗 2021-01-12 02:30

How to: Create Item Templates in Visual Studio 2017. In VS 2015 from the File menu there was an Export Templates item from which projects or item could be created. Is this

相关标签:
4条回答
  • 2021-01-12 02:52

    I did find Create Item Templates in Visual Studio 2017 under the Projects menu. And I am able to export items and import them in to other projects.

    0 讨论(0)
  • 2021-01-12 02:54

    As stated 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. In order 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. Additionally, if you want to further define where in the New Projects dialog box your template will appear, you will need to dig deeper in the path.

    For example, if you have a .NET core template written in C#, you will want to place 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 coolest thing about this is that you can create a collection of templates for your own organization, you could place the templates in a path such as... C:\Users\[UserName]\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C#\Daffitt Technologies\.NET Core. This will look something like this:

    One thing to note, is that there may be other tweaks you’ll have to do to the files contained in the zip file – particularly the MyTemplate.vstemplate file. I noticed that the created project templates don’t always create the results I expected.

    0 讨论(0)
  • 2021-01-12 03:04

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

    0 讨论(0)
  • 2021-01-12 03:12

    it moved to project menu however I have exported several things and none of them show up haven't figured out how to make it work

    0 讨论(0)
提交回复
热议问题