6

I'm trying to avoid having compile errors block the whole ASP site while we are in development. That is, I want each page to compile on first run instead of the whole site so that compile errors do not show up globally. That can be danged annoying when a dev takes off for lunch after saving with a systnax bleherror.

I've tried adding this to ye olde web config (changed from default "Always"):

<pages compilationMode="Auto" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> 

This did not have the desired effect. What can I change in the webconfig or using IIS to disable precompilation?

FlavorScape
  • 13,301
  • 12
  • 75
  • 117
  • Compilation of what; the aspx files, or their code-behinds? – Andrew Barber Apr 26 '12 at 01:45
  • Far as the problem concerned, it applies to both really. During the request-compile-response cycle I don't really see a difference. – FlavorScape Apr 26 '12 at 01:48
  • So you are doing the code behinds from App_Code? Pretty sure the answer you accepted won't affect that... but OK! – Andrew Barber Apr 26 '12 at 01:52
  • Yes, it does. All my forms have App_Code codebehinds and I get the desired behavior. The compiler maintains that relationship. – FlavorScape Apr 26 '12 at 01:57
  • If you have devs deploying code with compile errors to a shared server, you have bigger problems. – marknuzz Nov 10 '15 at 20:08
  • 1
    @Nuzzolilo hah, this was years ago. we had a small staff and had not setup our deployment pipeline yet to run tests, compile etc. It was literally check in to dev branch and dev environment would just pull regardless of errors. I had some devs that would mess up occasionally blocking us. You know, the junior dev check-in-and-go-home syndrome. – FlavorScape Nov 10 '15 at 20:38

1 Answers1

7

Web.config

<compilation batch="false" />

Indicates whether batching is supported. If True, 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. The default is True.

https://msdn.microsoft.com/library/s10awwz0.aspx

In IIS 7

To Use the UI Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

In Features View, double-click .NET Compilation.

On the .NET Compilation page, edit settings as necessary.

When finished, click Apply in the Actions pane.

http://technet.microsoft.com/en-us/library/cc725812(v=ws.10).aspx

Community
  • 1
  • 1
msigman
  • 4,474
  • 2
  • 20
  • 32
  • Oh OK. It wasn't clear to me in half the docs I dug through that batch compile was the effecting option. Thanks. – FlavorScape Apr 26 '12 at 01:45