To avoid an automatic restart based on the number of updated files, set the
numRecompilesBeforeAppRestart attribute in the Machine.config file from the default of 15 to a number that is larger than the number of files that will be updated between planned application restarts. If you set
numRecompilesBeforeAppRestart to a large number, you may want to restart the application manually to free the memory that the old versions of the assemblies use.
NOTE: If ASP.NET consumes too much memory, ASP.NET restarts that application automatically.
If you are updating a known number of files, and if you want to restart the application automatically, set
numRecompilesBeforeAppRestart to a number that is just less than the number of files that will be updated. This causes a single application restart with a small number of old assemblies in memory. For example, set
numRecompilesBeforeAppRestart as follows:
<compilation debug="false" explicit="true" numRecompilesBeforeAppRestart="50" defaultLanguage="vb">