I added the Swashbuckle package to my ASP Core project.
I would like to configure Swagger to use the automatically generated VS xml comments.
The problem is that I cannot find a way to get this location:
PlatformServices.Default.Application.ApplicationBasePath - points to the root path of the projectDirectory.GetCurrentDirectory() - samePath.GetFullPath(".") - sameIHostingEnvironment.WebRootPath - same
The output folder is configured in the <project>.xproj on BaseIntermediateOutputPath .
But I cannot get this location at runtime.
var pathToDoc = "????"; options.OperationFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlActionComments(pathToDoc));
Bad solutions that I see:
- add configuration parameter to AppSettings.json
- Relative path from the project path (as I am setting up the bin output path).
But I would like to use this with Docker, CI, localhost, so I donβt think that this would be the best solution for using a hard-coded solution.
deeptowncitizen
source share