asp.net-core - Dotnet核心输入开关无效: -t

标签 asp.net-core visual-studio-code .net-core

我试图弄清楚 dotnet core 是如何工作的,因此创建了一些项目来使用它。我找到了一个指南,他们说我应该运行“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.

他们改变了吗?为什么当我运行“dotnet new”时没有出现任何文档,但只有当我执行“dotnet new mvc”或“dotnet new web”时才出现。我正在使用 Visual Studio Code。

提前致谢。

最佳答案

是的,作为从 project.json 迁移回 csproj 的一部分,他们更改了 CLI 工具。更多信息请关注官方documents .

最好的来源是 dotnet new 的最新文档:

Creates a new project, configuration file or solution based on the specified template.

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]

Examples:

dotnet new mvc                   ==> New C# MVC app
dotnet new console -lang f#      ==> New F# console app

关于asp.net-core - Dotnet核心输入开关无效: -t,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42806355/

相关文章:

.net - 将完整的 .NET Framework 与现有的 ASP.NET Core 项目结合使用

asp.net-core - ASP NET Core 2 找不到包 'Projectname.Model' 的编译库位置

asp.net-core - 如何使用 [Authorize] 属性集成测试 ASP 5/Core Web API

VSCODE : how to ignore exceptions 中的 PHP 7 Xdebug

c# - 在 dotnet mvc 应用程序中连接到 Oracle 数据库

C# 保存历史表与具有依赖注入(inject)的 Entity Framework 的接口(interface)

c# - 将客户端证书添加到 .NET Core HttpClient

c# - 如何获取 blazor 中单选按钮的值?

visual-studio-code - 如何自己在 VSCODE 上发布扩展

json - 我可以在 vs 代码中为一种以上的语言配置 task.json 文件吗?