A native DotNet application will load all referenced assemblies (and their references) on first use. However, an ASP.NET will load all referenced assemblies (and their references) on first access.
Is this understanding correct?
Is there a way to force ASP.NET to load assemblies on demand (like local applications)?
The specific scenario I am trying to resolve is:
- The bin folder contains 2 files : A.dll and B.dll.
- A.dll references B.dll.
- B.dll references C.dll which is somewhere else on the system. In this case, C.dll is missing.
- A.dll is loaded (using reflection) by the main application.
- The error encountered (Could not load file or assembly...) relates to a missing dependency of B.dll.
- We want the application to function as normal if C.dll is missing as this is an optional component of the main application.
- We have no control over the contents of B.dll or C.dll.