Dotnet核心输入开关无效:-t

Fil*_*lah 7 .net-core visual-studio-code asp.net-core

我正在试图弄清楚dotnet核心是如何工作的,因此创建了一些项目来解决它.我找到了一个指南,他们说,我应该运行"dotnet new -t web"来创建功能更全面的Web应用程序.但是,当我这样做时,它只是说:

Invalid input switch:
  -t 

Template Instantiation Commands for .NET Core CLI.

Usage: dotnet new [arguments] [options]

Arguments:
  template  The template to instantiate.
Run Code Online (Sandbox Code Playgroud)

他们改变了吗?当我运行"dotnet new"时,为什么没有任何文件出现,但只有当我做"dotnet new mvc"或"dotnet new web"时才会出现.我正在使用Visual Studio Code.

提前致谢.

Dan*_*.G. 8

是的,他们更改了CLI工具,作为从project.json后面移动的一部分csproj.有关官方文件的更多信息.

最佳来源是最新文档dotnet new:

根据指定的模板创建新项目,配置文件或解决方案.

dotnet new <TEMPLATE> [-lang|--language] [-n|--name] [-o|--output] [-all|--show-all] [-h|--help] [Template arguments]
dotnet new <TEMPLATE> [-l|--list]
dotnet new [-all|--show-all]
dotnet new [-h|--help]
Run Code Online (Sandbox Code Playgroud)

例子:

dotnet new mvc                   ==> New C# MVC app
dotnet new console -lang f#      ==> New F# console app
Run Code Online (Sandbox Code Playgroud)