0

Normally, one can specify a service binding using the app.config file, and the system will automatically read from there. But what if my program is only a library (non-executable dll)? It can't have an app.config, and I can't change the main app code or config file. I can specify service binding using code, but this is not a good idea because I don't want to have to recompile each time binding changes.

My idea is having the complete tag in a text file, my dll will read it and parse it to an WSHttpBinding object, and my code will use this object to create the service client.

How do I do the parsing?

Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
  • 3
    There has to be a process that calls your class library. That application's config file is where you'd put your configuration settings. The host application will load the configuration and will make those available to your class library as if they were in it's own app.config file. – Vassili Altynikov Jul 25 '11 at 02:45
  • yeah.. problem is I'm not supposed to modify that main application – Louis Rhys Jul 25 '11 at 02:50

2 Answers2

1

I think, this posts are related:

Community
  • 1
  • 1
adontz
  • 1,428
  • 16
  • 36
0

Check out the source code in this forum post

Louis Rhys
  • 34,517
  • 56
  • 153
  • 221