I'm working with an MVC project. Some of the razor views have some markup errors here and there, but Visual Studio has no problems building it anyway (no warnings, no errors, and no informational messages) and there are no issues on the front-end. However, NCrunch cannot build the project until I fix the markup issues on the razor views.
When I click on a failing project in the NCrunch Tests window, I see:
Views\Shared\Event.cshtml (38, 8): Helper blocks cannot be nested within each other.
Views\Shared\Event.cshtml (81, 79): The "br" element was not closed. All elements must be either self-closing or have a matching end tag.
Views\Shared\Event.cshtml (78, 3): The "p" element was not closed. All elements must be either self-closing or have a matching end tag.
Views\Shared\Event.cshtml (33, 4): The "br" element was not closed. All elements must be either self-closing or have a matching end tag.
I am aware I can just go in and fix the markup, but some of the markup is pre-compiled by our designers.
I have no unit tests involving razor views, and there are no plans to add any in the future. I'd like to know why NCrunch can't just move past these errors.
These errors are being reported by a step in your build process that returns them with an error code. It isn't clear to me why this isn't causing your normal build to fail - it might be possible that NCrunch is building your project with a different $(Configuration) or $(Platform) than you have set in Visual Studio. See http://www.ncrunch.net/documentation/considerations-and-constraints_project-build-platform-and-configuration for more details on this.
If this isn't being caused by a platform/configuration issue, I'd suggest taking a close look at the project file and the build targets it calls. You may be able to suppress the build target responsible for the syntax checking with a build override. If the syntax checking build target is turned off for NCrunch, then it won't report the errors. Often MS build targets can also be suppressed by placing an extra property in the project file.