Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does ASP.NET load all assemblies into the AppDomain from the bin?

Does ASP.NET load all assemblies into the AppDomain from the bin folder?

Why I ask is because I'm trying to look for specific implementations of an interface and it seems to be resolving them without an explicit Assembly.Load(...).

like image 672
Daniel A. White Avatar asked Oct 19 '11 18:10

Daniel A. White


2 Answers

I think it does load them all, via System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory(). I get that in profiling stack traces but can't find much documentation of it.

Fellow SO'ers discuss controlling it here though: How to stop ASP.NET from loading all assemblies from bin on first load

like image 89
Scott Stafford Avatar answered Sep 27 '22 01:09

Scott Stafford


It will not load them unless they are referenced (either statically or dynamically). But the Bin folder is considered part of the probing path, so it will get used to try to load Assemblies.

like image 44
tcarvin Avatar answered Sep 23 '22 01:09

tcarvin