From the course: ASP.NET MVC: Building for Productivity and Maintainability

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Enabling view compilation to detect errors at build time

Enabling view compilation to detect errors at build time

From the course: ASP.NET MVC: Building for Productivity and Maintainability

Start my 1-month free trial

Enabling view compilation to detect errors at build time

- [Instructor] Perhaps the most straightforward and low risk tactic you could take to improve the quality of your ASP.NET MVC application is to tell Visual Studio to compile your views for you to help you find any coding errors at compile time instead of at run time. I'll start with a good example of how view compilation can help you find issues in your code before it's too late. Take a look at the product list you've shown here. Particularly the error that Visual Studio is highlighting on Line 17. This is a real bug in my application that Visual Studio's Intellisense is able to identify. However when I build my application this error is not included and the build is successful. Even though this bug exists in my view. That is because views are not included in the build by default. However ASP.NET MVC gives us a great feature to help us find these types of issues and include them with the rest of the compilation failures that Visual Studio reports. The problem is you won't find it in…

Contents