Reputation: 6473
I have a Asp.Net MVC 4 View (Razor), which includes a model like below:
@model Project.Models.TestModel
The problem is that if I go the project, and rename TestModel
to TestModel2
, and I click on rebuild project, no errors are given. If I open up the .cshtml
file directly, then I do get the error there.
Can you enforce such errors to be given immediately at compile time?
Upvotes: 5
Views: 1730
Reputation: 26930
Open *.Web.csproj file and change this:
<MvcBuildViews>false</MvcBuildViews>
to true
Upvotes: 4