dotnet new api -aot 返回 ‘-aot’ 不是有效选项。

huangapple go评论43阅读模式
英文:

dotnet new api -aot returns '-aot' is not a valid option

问题

以下是已翻译的内容:

我正在使用以下命令,

C:\Users\myUser>dotnet --info
.NET SDK:
 Version:   8.0.100-preview.4.23260.5
 Commit:    2268e7b15c

然后尝试创建一个应用程序,

C:\Users\myUser>dotnet new api -aot
错误:无效的选项:
-aot
   '-aot' 不是一个有效的选项

要获取更多信息,请运行:
   dotnet new api -h

我已安装了dotnet 8预览4,并使用Visual Studio 17.0预览1,尝试使用来自此博客文章https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-3/#minimal-apis-and-native-aot 的AOT。

英文:

I am using the below command,

C:\Users\myUser>dotnet --info
.NET SDK:
 Version:   8.0.100-preview.4.23260.5
 Commit:    2268e7b15c

and then try to create an app,

C:\Users\myUser>dotnet new api -aot
Error: Invalid option(s):
-aot
   '-aot' is not a valid option

For more information, run:
   dotnet new api -h

I have installed dotnet 8 preview 4 and using Visual Studio 17.0 Preview 1 and trying to use AOT from this blog post https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-3/#minimal-apis-and-native-aot

答案1

得分: 1

为了使用AOT模板创建项目,您需要使用--aot(两个连字符)

dotnet new api --aot

也许文档中有一些遗漏,但您可以通过以下命令确保:

dotnet new api -h
英文:

For creating project with AOT template you need to use --aot (2 hyphens)

dotnet new api --aot

Maybe there is some missing in that document but you can be sure by this command:

dotnet new api -h

huangapple
  • 本文由 发表于 2023年6月5日 14:28:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76403974.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定