V3 Documentation
Search

Pre-load All Assembly References Into Test Environment

Project-level NCrunch configuration setting Default Value: False

Purpose

This configuration setting controls the manner in which NCrunch will wire together an application domain for the execution of tests.

NCrunch test application domains differ from those used by many other test runners. The assemblies loaded into an NCrunch test application domain are usually not collocated and thus NCrunch needs to exert control over how these assemblies are loaded.

When this configuration setting is enabled, NCrunch will enforce tight control over the assemblies loaded into the test application domain, by pre-loading all dependencies before tests begin execution. This reduces the risk of the wrong assemblies being loaded on-demand at the expense of greatly increasing the time taken to set up the test environment.

When this configuration setting is disabled, NCrunch will attempt to guide the loading of assemblies during test run-time, allowing dependencies to be loaded on-demand. Although this approach is much faster, it increases the risk of test code interfering with NCrunch's arrangement of the test environment.

Recommendations

In almost all cases, it should be sensible to leave this configuration option disabled. Loading of referenced assemblies on-demand results in a significant improvement in test cycle times and is only likely to cause problems in rare edge case scenarios.

NCrunch very carefully monitors the assemblies that are loaded into its test application domain. If this configuration setting is disabled and an assembly is somehow loaded from the wrong place, NCrunch will issue a warning indicating that the resolution of assemblies in the test domain was not consistent. Unless you are receiving this warning on one of your projects, it is strongly recommended that you do not enable this configuration setting.