MVC3 compiles views slowly

When working on a C # MVC3 application in Visual Studio 2010, I turned on view compilation by editing the project file and setting a wonderful flag

`<MvcBuildViews>false</MvcBuildViews>` 

to true. I like this because it means that I can compile my views and catch mistakes.

The only problem I am facing right now is that it is not very fast! (I tried turning it off and then returning at full speed.)

It seems he will recompile each view every time - at the moment I have about 50 views, so ideally he will only compile pages that have changed from the last time. Is it possible?

+4
source share
2 answers

I do not think that it can be assembled in this way in the same project. You can try to put them in a separate project and configure it that way.

http://www.chrisvandesteeg.nl/2010/11/22/embedding-pre-compiled-razor-views-in-your-dll/

+2
source

As far as I know, creating views is an all or nothing flag.

I recommend disabling this option for the development environment, but enabling it for a continuous build system that points to your main development branch. That way, you can still get an email if you commit something that breaks the view without adding a lot of time for each build during development.

+2
source

Source: https://habr.com/ru/post/1397700/


All Articles