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

Sentinel One Strikes Again. No internet connection. Uninstall Sentinel One Agent.

A2 Hosting Let's Encrypt Can't Install Certificate on ASP.NET Core Application

NuGet Package Reference NU6105 Publish Error