.NET - deploying a WCF client, without an app.config

前端 未结 2 893
猫巷女王i
猫巷女王i 2020-12-24 14:25

I\'m writing a client to a WCF service. This is a single app in a larger system that includes modules written in C#, C++, VB, and Java. All of the apps share common config

2条回答
  •  攒了一身酷
    2020-12-24 14:41

    WCF settings can be set in your code, with no need for an external configuration file. Addresses, bindings, endpoints, security, etc. can all be configured in code. This is the best way to be consistent across all of your WCF services and not allow users to tamper with these settings.

    I suggest you expose the address (host name and port number) to users and allow them to configure this somehow because addresses are specific to where your WCF services are hosted.

提交回复
热议问题