I've noticed a strange thing in the Visual Studio 2010 Prosessional (in the ASP.NET MVC 3 project). If I have the syntax like below, the compiler doesn't checks if there is any error inside.
<% foreach (var item in Model) { %>
<div class="author-box">
<div class="author-box-header">
<%: Html.ActionLink(item.Name, "", new { id = item.AuthorID }) %>
</div>
<div class="author-box-body">
Books: <%: Html.DisplayFor(o => item.Books.Count) %>
// Here's the error, shoutld be item.Book.Count
</div>
</div>
<% } %>
Only when I open that .aspx page by myself in the solution, then the compiler validates the code.
So, how to force the compiler to automatically chcecks the syntax while compilating the project ?