dotnet new api -aot: ‘-aot’ is not a valid option
Fix the '-aot is not a valid option' error by using the correct double-hyphen syntax: dotnet new api --aot.
The correct syntax for generating a project with AOT is --aot (with 2 hyphens). In this particular case, the correct command would be:
dotnet new api --aot