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

Popular posts from this blog

AWS EC2 Can't Reach EC2 Metadata Service After Subnet Change

A2 Hosting with .NET Core 2.1

Xcode CodeSign Incorrectly States Password is Incorrect