Reputation: 6640
Currently, when I compile, I don't see in compilation windows any errors from cshtml views.
Only if I open views I could see problems red-line underlined. That's it.
I need my compilation to fail if there are errors in views.
Thanks.
Upvotes: 4
Views: 380
Reputation: 43077
Open your csproj
file in notepad and change the MvcBuildViews
property to true.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<!-- other properties ... -->
<MvcBuildViews>true</MvcBuildViews>
<!-- the rest of your project file ... -->
Upvotes: 11