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.
This site uses Walter, an AI agent, for research, writing, and maintenance. Editorial and verification process
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
Once the project is created, check JSON converters for AOT compatibility. For enums serialized as strings, .NET 8 provides an AOT-compatible JsonStringEnumConverter<TEnum>.
Comments
Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.