Adrian Grigore

Archive for May, 2009|Monthly archive page

ASP.NET MVC Tip #2: Turn on compile-time View Checking

In ASP.NET, ASP.NET MVC on May 3, 2009 at 16:01

I like the compiler to catch as many errors as possible before I start debugging or release my application. This also applies to code nuggets in ASP.NET MVC views, especially since these are not easily unit-testable. But views are not validated at compilation, at least not when using the standard settings for ASP.NET MVC projects.

Tools like Resharper can notify you of syntax errors within your views, but you can still build the project and not get a single error. Instead, your application will crash when trying to evaluate the buggy view.

Fortunately you can easily make Visual Studio compile your views along with the rest of your code. Read the rest of this entry »

Advertisements