- People says that libraries shouldn’t have configuration files.
- I can’t pass arguments to my WCF service class from its host (but I can from the client).
- I don’t want to store the configuration on the client.
- What should I do?
People says that libraries shouldn’t have configuration files. I can’t pass arguments to my
Share
What are you asking? Are you talking about settings for the service (the server side), or the client?
Why can’t you just use client-side config files like you do for other apps? This is the built-in, preferred way of doing things – why insist on not using it??
So again: what is it really that you’re asking? Or what problem is it, that you’re trying to solve, really?
for a service (server-side): store your bindings, behaviors, service endpoints etc. in the web.config (if hosting in IIS) or in the app.config of your service host (if NT Service or console app)
for a client: store your configuration in the main app’s app.config that uses your library. If you want to, you can provide ready-made “client.config” and “bindings.config” files and then just simply add
to your client app’s app.config – doesn’t get much easier than that, really!