Can a web.config read from an external xml file?

前端 未结 4 1124
死守一世寂寞
死守一世寂寞 2020-11-30 03:43

I have to duplicate some settings (like connection string) between a web.config file that a WCF host uses and a web.config file that a web client uses.

In the intere

4条回答
  •  悲哀的现实
    2020-11-30 03:53

    Yes, any configuration section can be "externalized" - this includes things like , and many more.

    You'd have something like this in your web.config:

    
          
       
           
          
          
           
    
    

    The externalized config's would just contain that one subsection in them:

    httphandlers.config:

    
        
        
        
        
    
    

    Note you cannot externalize the entire part, since that is a configuration section group - not a configuration section - but you can externalize most of the sub-sections contained in system.web.

提交回复
热议问题