开发者

Are asp.net pages compiled per page or per folder?

My understanding is asp.net pages are grouped in folders and each folder is compiled into a dll file. However when a page is requested the first time, only that page is compiled? So is it possible to compile part of a dll file? And when a page is requested, is it only the page's code within the dll file is executed, but not开发者_如何学编程 the whole dll? Somehow I'm under thr impression that a dll file should be compiled or executed as a whole.


Your answer exists within ASP.NET Compilation Overview and the compilation element.

Directories are compiled when browsed to, but the batch=true/false configures if only the loaded page will be compiled, or all of the pages in that directory. (There's a maxBatchSize that configures maximum of pages to compile in a batch.)


Page can compile per folder if you have enable the batch=true. The compiler compile the first n page that found on the folder un-compiled.

Also compiles all the modules that need for the page that you run. When again found one other page that have not been compiled then again compile a second set of n files.

The limits of the how many files are compile with the batch=true, are set from the compilation settings .

If I understand well you search a way to seed up the developmental.

For your development computer I suggest 2 settings.

<compilation batch="false"  optimizeCompilations="true" ... >

When batch=false then only the file you ask is called. When optimizeCompilations=true then the compiler did not build the functions on the dlls, nether some cache files if they have not change.

Read also: Slow Performance -- ASP .NET ASPNET_WP.EXE and CSC.EXE Running After Clicking Redirect Link

If you have problems with the compilations then set optimizeCompilations=false.

When the optimizeCompilations is on, there are case that the compile can not understand the change of a function and you get errors. One case is when you have a function call, and change the function by just adding an argument with a default value (net4). In this case the compiler did not compile it again, and this some times product errors.


However when a page is requested the first time, only that page is compiled?

If your application is a website,when it calls first time that aspx page compile automatically.But not for web application it will compile once when you build

So is it possible to compile part of a dll file? Means you want to compile particular part of a project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜