If you are using ASP.NET MVC you might have noticed that you will not be alerted of build errors that exist in your views until you navigate to those pages. When you do so you'll get a runtime error L Thankfully there is a very easy way to change this. All you have to do is open the project file and change the value for the MvcBuildViews property to true. To do this, follow these steps.
- Right-click on the MVC project and select 'Unload Project'
- Right-click on the unloaded MVC project and select 'Edit …'. This will open up the project file itself, which of course is an MSBuild file.
- Look for the MvcBuildView property and set its value to true. It should be <MvcBuildViews>true</MvcBuildViews>
- Save the project file, right-click on the MVC project again and select 'Reload project'
After this if you introduce any build errors into the views then you will be notified when the project is built.
Sayed Ibrahim Hashimi