0

From the Ahoy repository's examples (see the README), in the basic example, they do use XML Comments to generate some metadata for Swagger to serve up. However, they only configure it if the app is in the Development configuration. See that specific setup here.

However, what if we want to keep the metadata generated by the XML comments for our production environment? Do you suggest deploying with XML Comments enabled - does it matter? What are you currently doing? Is there a better way?

I'm creating an API that will be consumed by other developers. I want the metadata I've placed in XML comments to be out there for those developers to see in production, not just the Swashbuckle-generated things from the ASP.NET Core annotations.

steamrolla
  • 2,373
  • 1
  • 29
  • 39
  • 1
    I use it. All you need is to enable xmldoc generation and swagger to read it. The xml files get deployed with the project (also of referenced class libraries) – Tseng Nov 18 '16 at 16:45
  • Thank you for the input, @Tseng. Good to know. I saw their example and thought of reasons to do what they do, but, ultimately, it's just XML sitting side-by-side to a DLL in production, and only being used when someone hits `/swagger` endpoints. Wanted to know what others thought of this and if it's a bad thing. – steamrolla Nov 18 '16 at 16:48
  • 1
    Maybe an relict of dnx times. Up until RC2, ASP.NET Core used dnx and dnx tools rather than the current dotnet-cli, which resulted in a different folder structure so the artefact directory was much harder to build at runtime and when deployed on azure the xml docs were inside the package folders, not in the folder with the binary files so you had to do something like `$@"{basePath}\packages\{applicationName}\{applicationVersion}\lib\{runtimeIdentifier}{runtimeVersion}\{applicationName}.xml"`to get the xml's path on azure.. – Tseng Nov 18 '16 at 16:54
  • 1
    .. and `$@"{basePath}\artifacts\bin\{applicationName}\{configuration}\{runtimeIdentifier}{runtimeVersion}\{applicationName}.xml"` on local – Tseng Nov 18 '16 at 16:54

0 Answers0