This is certainly one of those that drives you nuts. As the title indicates all I'm simply trying to do is display comments pulled from an xml file using swagger.
I appear to have taken all steps according to the swagger documentation but to no avail. Hopefully you kind folk can point me in the right direction.
Ensured file exists:
Configured SwaggerConfig.cs
I've tried changing the path too: @"bin/....xml"
Nothing seems to work.
**The Error "Could not find file": **
Can anyone point me in the right direction please?
Regards,
Ok, So I managed to get it to work by pointing to the root directory.
I still have no idea why it cannot detect the xml file in the bin directory. Again this worked by adding an xml file within the root.
Code Changes:
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
//var commentsFileName = Assembly.GetExecutingAssembly().GetName().Name + ".XML";
var commentsFileName = "Comments" + ".XML";
var commentsFile = Path.Combine(baseDirectory, commentsFileName);
c.IncludeXmlComments(commentsFile);