dotnet new --install показывает информацию об использовании - PullRequest
0 голосов
/ 22 мая 2019

Когда я пытаюсь установить новый шаблон, используя следующее:

dotnet new --install . --name MyTemplate
или
dotnet new --install "Path" --name MyTemplate

Я получаю информацию об использовании:

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.

У меня есть каталог .template.config с файлом template.json в.

Содержимое файла template.json выглядит примерно так:

{
    "author": "My Department",
    "classifications": [
        "Solution Template"
    ],
    "name": "My Template Name",
    "identity": "My Template Identity",
    "shortName": "mytemplate",
    "tags": {
        "language": "C#"
    },
    "sourceName": "Company.Product",
    "preferNameDirectory": "true"
}

Я, конечно, хотел бы, чтобы он сказал мне, что я делаю неправильно. Это работало для меня в прошлом.

1 Ответ

1 голос
/ 22 мая 2019

Работа команды dotnet new --install, к сожалению, немного сбивает с толку.Установка может быть успешной, но вывод не делает это очевидным.Вы получите информацию об использовании и список установленных шаблонов, которые должны включать ваш новый.

Поскольку упоминается в комментариях , существует ошибка , поданная , которая имеет цельючтобы привести в порядок это.

...