question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet new my-template does not create output files

See original GitHub issue

I am trying to create a template for some dotnet/react based boilerplate: https://www.nuget.org/packages/JBuschke.Glue.Starter/. After installing via dotnet new -i JBuschke.Glue.Starter::* and running dotnet new gluestarter (the templates short name), no output files are created. Only some help output, the projects description and author are logged to the console:

dotnet new gluestarter
Usage: new [options]

Options:
  -h, --help          Displays help for this command.
  -l, --list          Lists templates containing the specified name. If no name is specified, lists all templates.
  -n, --name          The name for the output being created. If no name is specified, the name of the current directory is used.
  -o, --output        Location to place the generated output.
  -i, --install       Installs a source or a template pack.
  -u, --uninstall     Uninstalls a source or a template pack.
  --nuget-source      Specifies a NuGet source to use during install.
  --type              Filters templates based on available types. Predefined values are "project", "item" or "other".
  --dry-run           Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force             Forces content to be generated even if it would change existing files.
  -lang, --language   Filters templates based on language and specifies the language of the template to create.


Opinionated ASP.NET Core + React boilerplate (C#)
Author: Jannik Buschke
    (No Parameters)

the template.json:

{
  "$schema": "http://json.schemastore.org/template",
  "author": "Jannik Buschke",
  "classifications": ["AspNetCore", "React"],
  "groupIdentity": "JBuschke",
  "identity": "JBuschke.Glue.Starter",
  "name": "Opinionated ASP.NET Core + React boilerplate",
  "shortName": "gluestarter",
  "tags": {
    "language": "C#",
    "type": "project"
  },
  "sourceName": "TemplateName",
  "preferNameDirectory": false
}

the nuspec file:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <id>JBuschke.Glue.Starter</id>
    <version>0.9.3</version>
    <description>
    Opinionated Asp .Net Core + React template
      https://github.com/jannikbuschke/glue-reactnetcore-template
    </description>
    <authors>Jannik Buschke</authors>
    <packageTypes>
      <packageType name="Template" />
    </packageTypes>
  </metadata>
</package>

The cached packages ~\.templateengine\dotnetcli\v2.2.104\packages\jbuschke.glue.starter.0.9.2.nupkg\ content looks alright to me:

/JBuschke.Glue.Starter.nuspec
/content/.template.config/template.json
/content/<template-files>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jannikbuschkecommented, Jun 10, 2019

My problem was that I had two templates with the same “groupIdentity”.

0reactions
jannikbuschkecommented, Jun 9, 2019

The weird thing is, the template actually seems to work.

dotnet new -i JBuschke.Glue.Starter::*
dotnet new gluestarter

correctly initializes the project.

However I have a second template (different content, different id) JBuschke.AspCra which if installed causes both templates to fail (no output for both).

If I only install one of them it works.

{
  "$schema": "http://json.schemastore.org/template",
  "author": "Jannik Buschke",
  "classifications": [
    "AspNetCore",
    "React"
  ],
  "groupIdentity": "JBuschke",
  "identity": "JBuschke.Glue.Starter",
  "name": "Opinionated ASP.NET Core + React boilerplate",
  "shortName": "gluestarter",
  "tags": {
    "language": "C#",
    "type": "project"
  },
  "sourceName": "TemplateName",
  "preferNameDirectory": false,
  "defaultName": "MyApp"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom templates for dotnet new - .NET CLI
Learn about custom templates for any type of .NET project or files.
Read more >
Create an item template for dotnet new - .NET CLI
Learn how to create an item template for the dotnet new command. Item templates can contain any number of files.
Read more >
dotnet new <TEMPLATE> - .NET CLI
The dotnet new command creates new .NET projects based on the specified template.
Read more >
Create a project template for dotnet new - .NET
In this tutorial, your template folder is located at working\templates\consoleasync. When you create a template, all files and folders in the ...
Read more >
Create a template package for dotnet new - .NET
With .NET, you can create and deploy templates that generate projects, files, and even resources. This tutorial is part three of a series ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found