ServiceStack:运行 "web new web-corefx ProjectName" 创建一个 .NET Framework 4.x 项目
ServiceStack: Running "web new web-corefx ProjectName" creates a .NET Framework 4.x project
阅读 Servicestack web pages 后,我得出的结论是 运行 以下命令将创建一个 (ASP).NET Core web 项目:
web new web-corefx ProjetName
但是,当我这样做时,我收到一条信息:
D:\test>web new web-corefx Test
Installing web-corefx...
INFO: Could not find files for the given pattern(s).
running dotnet restore...
Restore completed in 576,34 ms for D:\...\Test.ServiceModel\...
Restore completed in 761,72 ms for D:\...\Test.ServiceInterface\...
Restore completed in 802,11 ms for D:\...\Test.Tests\...
Restore completed in 1,24 sec for D:\...\Test\Test\Test.csproj
Test web-corefx project created.
当我在 Visual Studio 2019 年打开项目时,我看到了这个:
... 这告诉我 未 创建 .NET Core 项目。
为了确保 .NET Core 3 已安装并正常工作,我通过 "Add new projet" 对话框创建了一个 "ASP.NET Core Web Application",然后它按预期显示:
我是否误解了如何使用 "web" CLI 命令?
更新
我也试过 x new
命令,像这样:
x new web-corefx TestProject
它给了我同样的问题 - .NET Framework 4.7 项目而不是预期的 .NET Core。
然而,运行 只是 x new web TestProject
给了我一个 .NET Core 项目,但不是我想要的模板...
请阅读ServiceStack Template Docs you linked to closely. The project templates ending with -corefx
all create ASP.NET Core Apps on the .NET Framework。
ServiceStack .NET Core C# Project Templates 属于第一组,因此如果您想创建一个空的 .NET Core web 项目,您可以删除后缀,例如:
$ dotnet tool install --global x
$ x new web TestProject
阅读 Servicestack web pages 后,我得出的结论是 运行 以下命令将创建一个 (ASP).NET Core web 项目:
web new web-corefx ProjetName
但是,当我这样做时,我收到一条信息:
D:\test>web new web-corefx Test
Installing web-corefx...
INFO: Could not find files for the given pattern(s).
running dotnet restore...
Restore completed in 576,34 ms for D:\...\Test.ServiceModel\...
Restore completed in 761,72 ms for D:\...\Test.ServiceInterface\...
Restore completed in 802,11 ms for D:\...\Test.Tests\...
Restore completed in 1,24 sec for D:\...\Test\Test\Test.csproj
Test web-corefx project created.
当我在 Visual Studio 2019 年打开项目时,我看到了这个:
... 这告诉我 未 创建 .NET Core 项目。
为了确保 .NET Core 3 已安装并正常工作,我通过 "Add new projet" 对话框创建了一个 "ASP.NET Core Web Application",然后它按预期显示:
我是否误解了如何使用 "web" CLI 命令?
更新
我也试过 x new
命令,像这样:
x new web-corefx TestProject
它给了我同样的问题 - .NET Framework 4.7 项目而不是预期的 .NET Core。
然而,运行 只是 x new web TestProject
给了我一个 .NET Core 项目,但不是我想要的模板...
请阅读ServiceStack Template Docs you linked to closely. The project templates ending with -corefx
all create ASP.NET Core Apps on the .NET Framework。
ServiceStack .NET Core C# Project Templates 属于第一组,因此如果您想创建一个空的 .NET Core web 项目,您可以删除后缀,例如:
$ dotnet tool install --global x
$ x new web TestProject