---
title: "How to views compile in mvc?"  
description: "How to views compile in mvc?"  
author: "Jayden Bell"  
published: 2014-10-06  
updated: 2014-10-06  
canonical: https://www.mindstick.com/forum/2316/how-to-views-compile-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc"]  
reading_time: 1 minute  

---

# How to views compile in mvc?

I want an msbuild [task](https://www.mindstick.com/forum/161761/what-is-the-difference-between-task-and-thread) to compile the [views](https://www.mindstick.com/forum/12838/compile-views-in-asp-dot-net-mvc) so I can see if there are compile time [errors](https://answers.mindstick.com/qa/116170/fresh-fir-against-gandhis-in-national-herald-case-cover-up-for-ed-s-own-errors) at well... compile time. Any [ideas](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas)?

## Replies

### Reply by Anonymous User

I frankly would recommend the RazorGenerator nuget package. That way your views have a .designer.cs file generated when you save them and on top of getting compile time errors for you views, they are also precompiled into the assembly (= faster warmup) and Resharper provides some additional help as well.

To use this include the RazorGenerator nuget package in you ASP.NET MVC project and install the "Razor Generator" extension under item under Tools -> Extensions and Updates

We use this and the overhead per compile with this approach is much less. On top of this I would probably recommend .NET Demon by RedGate which further reduces compile time impact substantially.

Hope this helps.


---

Original Source: https://www.mindstick.com/forum/2316/how-to-views-compile-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
