简体   繁体   中英

How to "install" a dotnet core 2.2 custom template in Visual Studio

I have created a custom dotnet core project template following the documentation here: https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates

I can install this template, and create new projects from it, on the command line using dotnet new -i ...\\mycustomtemplate and dotnet new mycustomtemplate , respectively.

Now I would like to make this template available in Visual Studio (2017)'s new project wizard but I cannot find any documentation on how to do that.

Visual Studio help only contains info about creating "Visual Studio project templates", which use a completely different configuration than the dotnet core templates, and also would not work with the dotnet core cli, as far as I understand.

Could anyone give a hint where I could find some documentation how to "install" a dotnet core custom template in Visual Studio? I would really like to have a single template that works with both Visual Studio, Jetbrains Rider and the dotnet core cli.

Or is this simply not possible?

With all credits to @willwolfram18 :

  1. You have a working custom template in the NuGet package.
  2. Add vs-2017.3.host.json file to .template.config/ .
  3. Add Framework symbol to template.json .
  4. Place the .nupkg file(s) into the root of a VSIX extension project and make sure to set the "Include in VSIX" flag to True .

The detailed original answer and the working prototype .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM