I've added Swashbuckle
package to my ASP Core project.
I'd like to configure Swagger to use auto-generated by VS xml comments.
The problem is that I can't find the way to get that location:
PlatformServices.Default.Application.ApplicationBasePath
- points to the project root pathDirectory.GetCurrentDirectory()
- the samePath.GetFullPath(".")
- the sameIHostingEnvironment.WebRootPath
- the same
Output folder configured in <project>.xproj
by BaseIntermediateOutputPath
option.
But I can't get this location in runtime.
var pathToDoc = "????";
options.OperationFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlActionComments(pathToDoc));
Bad solutions I see:
- add configuration option to AppSettings.json
- Relative path from project path (as I'm configuring bin output path).
But I'd like to use this with Docker, CI, localhost, so I don't think this would be the best solution to use hard-coded solution..