Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch builds fail because of bad cshtml markup
blipson
#1 Posted : Wednesday, November 16, 2016 10:04:32 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/16/2016(UTC)
Posts: 2
Location: United States of America

Thanks: 1 times
Hi,

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:

Quote:

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.

Thanks,
Ben
Remco
#2 Posted : Wednesday, November 16, 2016 10:51:16 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Ben,

Thanks for sharing this issue.

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.
1 user thanked Remco for this useful post.
blipson on 11/16/2016(UTC)
blipson
#3 Posted : Wednesday, November 16, 2016 10:59:11 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/16/2016(UTC)
Posts: 2
Location: United States of America

Thanks: 1 times
Hi,

I had a hunch it's something to do with the build process, rather than NCrunch, but didn't see anything. I'll give it another look then.

Thanks!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download