开发者

WCF: Add service reference on client pulls the wrong information from hosted service

开发者 https://www.devze.com 2023-02-04 10:12 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号