Last post Dec 13, 2017 08:55 AM by tridip1974
Dec 12, 2017 08:48 AM|tridip1974|LINK
please guide me how to compile view and show in asp.net mvc4/5 ?
what will be the advantage of compiling view ?
when we compile view then how could i deploy or copy the view to product?
if we compile the view any dll file will be generated for each view ?
so if we compile the view and later when we will change html or css in view then every time we need to compile each view one after one.
please guide me. thanks
Dec 13, 2017 03:13 AM|zxj|LINK
Views are compiled at run-time, but controllers, models, and other classes are pre-compiled.
One of the features of any compiled language is to validate errors and warnings at compile time.
It reduces number of errors at the design phase instead of after running the program.
Models and controllers are pre-compiled but views are compiled at runtime.
So, any error in view can’t be detected until it is not run on the browser.
To overcome this problem, views can be pre-compiled.
There’s a simple way to change this, though, by setting the views to build at compile time.
1. Right-click on your project file in Visual Studio’s Solution Explorer and choose
2. Right-click the project file again and choose Edit YourProject.csproj.
3. Look for a node called <MvcBuildViews> in the first <PropertyGroup> node (the one without any other attributes). If it’s not there, add it.
4. Add or update the value inside the <MvcBuildViews> node to true. When you’re done it should look like this:
5. Save the project file changes.
6. Right-click the project file in Solution Explorer one last time and select
I suggest using the MvcBuildViews setting only for Release builds, assuming your build process uses a Release build before you deploy. This will
remove the extra wait to compile the views when you’re developing and debugging, but still keeps a check in place before you deploy.
Pre-compiled Razor View in ASP.NET MVC
Dec 13, 2017 08:55 AM|tridip1974|LINK
if i precompile our view then response or processing at server side will be faster ?
if i precompile our view then dll file will be generated for each view ?