Error When Generating OpenAPI Documents: Missing required option '--project'
After I installed Microsoft.Extensions.ApiDescription.Server package, I encountered the following error message when I attempted to generate OpenAPI documents at build-time on .NET 9.
Missing required option '--project'
The command "dotnet "..."" exited with code 1
Apparently, it was due to end slash on my attempt to change the output directory. On my csproj file, I have the following entry:
<PropertyGroup>
<OpenApiDocumentsDirectory>../directory/</OpenApiDocumentsDirectory>
</PropertyGroup>
It works correctly after I removed the end slash:
<PropertyGroup>
<OpenApiDocumentsDirectory>../directory</OpenApiDocumentsDirectory>
</PropertyGroup>
Comments
Post a Comment