What effect does the new precompile during publishing option have on MVC4 applications?

后端 未结 2 1918
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 23:01

So I recently updated Visual Studio 2012 to Update 2. Lo and behold, the next time I go to publish my application (via File Publish in this case) I notice that there are thr

2条回答
  •  旧时难觅i
    2020-12-04 23:31

    Using the ASP.NET precompiler can have the following impact on your MVC app:

    • If you have anything in App_Code, it will be precompiled into a DLL before deployment. Without precompiling, this would happen on the fly by the ASP.NET runtime.
    • If you choose the option to not make your pages updateable (i.e. uncheck the first checkbox in the advanced settings dialog), it will also precompile your views (ASPX and Razor) instead of compiling those dynamically at runtime as well. The default (checked) setting of "Allow precompiled site to be updateable" allows you to update your view content without needing to rebuild the entire project.

    If you don't have any files in App_Code and you want your site to remain updateable, it doesn't seem to do much.

提交回复
热议问题