我正在尝试创建一个新的dotnet react项目。我按照教程尝试了。
所以我先在命令提示符下运行dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
,然后再运行dotnet new react -o client
这就是结果,
C:\Users\xxx\Documents\Practice>dotnet new react -o client
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".
--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.
ASP.NET Core with React.js (C#)
Author: Microsoft
Options:
-f|--framework The target framework for the project.
netcoreapp2.0 - Target netcoreapp2.0
netcoreapp2.1 - Target netcoreapp2.1
Default: netcoreapp2.0
--no-restore If specified, skips the automatic restore of the project on create.
bool - Optional
Default: false / (*) true
--exclude-launch-settings Whether to exclude launchSettings.json from the generated template.
bool - Optional
Default: false / (*) true
--no-https Whether to turn off HTTPS. This option only applies if IndividualAuth or OrganizationalAuth are not being used.
bool - Optional
Default: false / (*) true
* Indicates the value used if the switch is provided without a value.
但是它没有在文件夹中创建新项目。