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

前端 未结 2 1713
佛祖请我去吃肉
佛祖请我去吃肉 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:24

    To answer point 3, the setting that causes all the assemblies in the bin folder to be loaded on first access can be found in the file C:\winnt\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config (depending on your environment). Cut-down extract from that file:

    
        
            
                
            
        
    
    

    All assemblies that match the wildcard are loaded as part of the initial compilation.

    By modifying the web.config for the application (NOT the global DotNet one) to include the web service assembly and exclude the wildcard match, it appears that the application can function if the optional dependencies are missing:

    
        
            
                
                
            
        
    
    

    We're still experimenting with this so not sure if this completely resolves the issue or has any unusual side-effects.

提交回复
热议问题