4

I have created a custom dotnet core project template following the documentation here: https://learn.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?

2
  • Hi, did you find a solution to this?
    – Stefan
    May 8, 2019 at 19:11
  • @Stefan no haven't found a solution yet. Haven't tried with VS 2019 though. Maybe it has support for dotnet core templates. Or maybe we'll all just have to wait until next year, when there will be only one .net left to rule them all.
    – heapifyman
    May 17, 2019 at 10:23

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.