We had a Windows Service Project hosting two of our WCF services and we could not figure out why the app.config settings on the WCF services were not pulling correctly to our client programs.
It turns out that the app.config for the windows service project takes precedent. When we moved the settings we wanted into the window service's app.config everything worked again.
Hope this saves someone a 4 hour lon开发者_运维技巧g headache!
You must copy configuration to hosting application. Only configuration from hosting application is applied. Configuration in WCF services is only for testing purpose like WCFTestClient.
If I remember correctly, the reason for this is because ConfigurationManager does not support config files inside dll's.
精彩评论