Closed
Description
Description
Hi!
I ran into dotnet/aspnetcore#59157 . It correctly states the docs are incorrect:
By default, the generated OpenAPI document will be emitted to the application's output directory. To modify the location of the emitted file, set the target path in the OpenApiDocumentsDirectory property.
<PropertyGroup>
<OpenApiDocumentsDirectory>./</OpenApiDocumentsDirectory>
</PropertyGroup>
The value of OpenApiDocumentsDirectory is resolved relative to the project file. Using the ./ value above will emit the OpenAPI document in the same directory as the project file.
Using this ./
path causes a build error. It should changed to .
to build correctly.
Page URL
Content source URL
Document ID
27bad30c-e0b4-10fb-b202-a29d4f8fad24
Article author
Metadata
- ID: 27bad30c-e0b4-10fb-b202-a29d4f8fad24
- Service: aspnet-core
- Sub-service: fundamentals
Activity
Rick-Anderson commentedon Jan 29, 2025
@sander1095 what OS and version? What .NET version?
This happened on preview versions but was fixed in .NET 9 GA.
sander1095 commentedon Jan 29, 2025
Copied from the comment in the PR: #34509
@Rick-Anderson
WSL (Ubuntu 22.04)
Windows 11 Pro (10.0.22631 Build 22631, 23H2)
Building with ./
The final csproj
Windows 11 Pro ❌
WSL (Ubuntu 22.04) ✅
Building with .
The final csproj
Windows 11 Pro ✅
WSL (Ubuntu 22.04) ✅
I hope this gives you all the info you need!
As far as I see it, this issue persists in .NET 9 GA but is fixed on both Windows and Ubuntu when using
<OpenApiDocumentsDirectory>.</OpenApiDocumentsDirectory>
, which is what this PR aims to fix in the docs.