We generate our public API documentation for our ASP.NET WebApi project using Swashbuckle, which we have configured to pick up the generated XML documentation file that the C# compiler produces.
I would like to be able to test this feature of our app (or perhaps even unit test my comments, checking for speeling errers :-)), but I can't figure out how to how to make it work in NCrunch. It looks as if NCrunch is flipping the "produce XML documentation file" flag to false when compiling the project. Is there a way to configure NCrunch to let the compiler generate my XML documentation file so that I can consume it from my tests?
Build/Test Issues
consuming generated xml documentation within tests
Started by mschaad on 4,874 views
Remco NCrunch Developer
#9022
21 Jul 2016 22:48 UTC
Hi, thanks for posting!
I have no personal experience with Swashbuckle, but my first guess would be to check that you have the pre/post build events enabled in NCrunch - http://www.ncrunch.net/documentation/reference_project-configuration_run-pre-or-post-build-events.
If this doesn't work, you may need to take a look at how Swashbuckle is tied into your build system. This means opening up your project file in a text editor and examining the XML to see how this tool is being referenced. It's possible they have code specifically designed to exclude tools like NCrunch (which you could theoretically work around).
Note that generating XML documentation on NCrunch builds will likely increase your build times significantly. It may be worth looking at ways to do this inside the test code itself so you don't add seconds to your cycle times for the majority of your tests that likely don't need it.
I have no personal experience with Swashbuckle, but my first guess would be to check that you have the pre/post build events enabled in NCrunch - http://www.ncrunch.net/documentation/reference_project-configuration_run-pre-or-post-build-events.
If this doesn't work, you may need to take a look at how Swashbuckle is tied into your build system. This means opening up your project file in a text editor and examining the XML to see how this tool is being referenced. It's possible they have code specifically designed to exclude tools like NCrunch (which you could theoretically work around).
Note that generating XML documentation on NCrunch builds will likely increase your build times significantly. It may be worth looking at ways to do this inside the test code itself so you don't add seconds to your cycle times for the majority of your tests that likely don't need it.
Post a reply
Log in to reply.