Daniel A. White
Daniel A. White

Reputation: 190996

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(...).

Upvotes: 5

Views: 1377

Answers (2)

Scott Stafford
Scott Stafford

Reputation: 44808

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

Upvotes: 4

tcarvin
tcarvin

Reputation: 10855

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.

Upvotes: 2

Related Questions