Why isn't a compilation needed when updating cshtml files with .net code?

前端 未结 2 1083
离开以前
离开以前 2021-02-14 11:08

I\'m using Asp.net Mvc and I wanted to know why I don\'t need to compile my project when updating .net code in cshtml files? Now if we are talking about html\\css updates then I

2条回答
  •  死守一世寂寞
    2021-02-14 11:50

    .cshtml files will be compiled just-in-time, that is when a request arrives regarding those pages.

    However controllers are pre-compiled and stored into your project's DLL files.

    Deciding which one to use, depends on your needs. Pre-compiling gives you less response time (because you've compiled the code before) but just-in-time compiling offers you flexibility.

提交回复
热议问题