How to stop ASP.NET from loading all assemblies from bin on first load

前端 未结 2 1709
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 03:37

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 refer

2条回答
  •  春和景丽
    2020-12-14 04:12

    asp.net loads all the assemblies needed because the worker process creates an app domain with all of the required assemblies for every instance.

    if you would like to load assemblies on demand try to use reflection in that way you can control wich and when to load your assemblies.

    **edit: **

    if you doesnt have control over B and C but you are saying that B needs C to run, and A has a hard reference to B. to me it sounds like you need ABC components to work, you can try to remove the B dependency from A by making it loosy couple.

    you can use reflection to load B from A but is B still needs C its going to still cause issues.

    how is your solution compiling with out the C component?

    is C stored in the GAC?

提交回复
热议问题