1.x To 2.0 Migration Tip: Temporarily Disable Batch Compilation

Posted on May 08, 2006  |  

Posted in Development

2 comments

If you’ve read through various migration HOW-TOs, you might’ve noticed a suggestion to turn off batch compilation and rebuild your project to see if any compilation errors come up. This is a very important point as the <compilation> section in web.config is a tricky one.

Here’s what an MSDN article suggests:

Open the web.config file and turn batch compilation off and re-compile that application to see if any further compilation errors might exist. This can be done by setting the batch=false attribute in the compilation tag as such: <compilation debug="true" batch="false"/>. Turning off batch compilation may expose masked compilation errors that may exist in the application but are not reported.

Important: The batch=false attribute should only be added to find such errors and then reverted once any additional compilation errors are fixed. Leaving batch=false in the compilation section has significant performance impact on build times for the application in Visual Studio 2005, so make sure you remove this attribute after doing this check.

More reading on this subject:

2 comments

Nico
on November 15, 2006

Interesting. I just found out that setting batch=false lets me start my asp.net 2.0 web app 10 times faster on my local machine! Also I dont get that annoying "no relevant source lines" error anymore when I start debugging. And if i think about it the msdn suggestion makes no sense.

Turning batch=true means that all your stuff within one directory is compiled into one dll at once. Right? Than THIS is the way to find masked compilation errors. Switching batch=false means dll's for every single page. As I mentioned, on my machine the batch=true option is very very slow. Every time when I start debugging the whole app is compiled and for every page a xml file must be generated and so on... Turning off batch compilation makes start debugging rocket fast. So I have to wonder about the suggestion above:

"Leaving batch=false in the compilation section has significant performance impact on build times for the application in Visual Studio 2005"

For me it's a real performance boost to use batch=false!

Maybe this helps other people that are very disappointed about VS2005 performance...


Milan Negovan
on November 15, 2006

Scott Guthrie had an interesting post along these lines, too.