Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web.config batch="false"

What is the purpose of adding the batch="false" in the compilation tag in ASP.NET 1.1?

like image 663
Danny G Avatar asked Mar 20 '09 19:03

Danny G


4 Answers

MSDN says the purpose of the batch flag

eliminates the delay caused by the compilation required when you access a file for the first time. When this attribute is set to True, ASP.NET precompiles all the uncompiled files in a batch mode, which causes an even longer delay the first time the files are compiled. However, after this initial delay, the compilation delay is eliminated on subsequent access of the file.

Having it set to false will probably make it compile faster the first time, but slower subsequent times, and I believe this applies to 1.1 as well.

MSDN Link

like image 98
Brandon Avatar answered Oct 05 '22 09:10

Brandon


I know this question is closed (and about v1.1) but the batch attribute is actually defaulted to True in .Net 2.0 onwards.

http://msdn.microsoft.com/en-us/library/s10awwz0%28VS.80%29.aspx

like image 24
Iron Lung Avatar answered Oct 05 '22 09:10

Iron Lung


In asp.net 1.1, when you compile in "batch mode" set to true, the output of the source files is compiled into single assemblies according to the directories, the type of file, etc. When "batch mode" is turned off, the output is a single assembly for the entire project.

Some of the advantages and disadvantages are described in this small paragraph from an MSDN article.

There are several issues you should be aware of when using this attribute.

  • Performance—when Batch=false, the ASP.NET compiler will create an assembly for every Web form and user control in your Web application. It also causes the compiler to do a full compile, not an incremental compile, in Visual Studio 2005 when you build using F5. The net result is your Web application may run slower when deployed, and your build times will increase significantly in Visual Studio 2005.
  • Assembly References—the Batch attribute may hide potential broken assembly references (when Batch=True), or even introduce a Circular Reference (when Batch=False).
like image 37
jdecuyper Avatar answered Oct 05 '22 11:10

jdecuyper


I believe the default is false (is in 2.0+) so the point of adding batch=false would be as a documentation of the default, or as a placeholder so it's obvious what to change if you want true.

like image 43
Walden Leverich Avatar answered Oct 05 '22 09:10

Walden Leverich