app.config for custom controls

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
I have created a custom composite control that derives from compositeControl using vs2005 in C#.
My control calls out to a web service that I created in a different project. It works well when I run it on my machine.
Now I want to deploy it. I know that my client will not have the web services running off of my machine and I want to give them the ability to change the machine where the web services are run from.

So my question is: how can I dynamically allow a user to set web service url references that my custom control will detect and use during runtime?

The best case scenario for me would be if I could expose the web service url from a public property on my control, along with all the other public properties that I have for it. Then a user could set this value in design mode and when run the control will use that url reference.

The problem I see with this is that when a web reference is set in studio there is a lot going on in the background in terms of proxy class and setup. If I then change that web ref during runtime will all that stuff occur?
What if I could guarantee that the new reference will always ref the same service so that I could pre-build the proxy class and not have to do it runtime?

Has anyone encountered an issue like this?

When I add my control to the toolbox I set a reference to the dll only. Yet I know the web reference is included because it works. So I'm guessing that the app.config file is being compiled into the dll. Does this mean that even if I could change the app.config I would still need to compile?

So many questions. I appreciate any help.
 
Back
Top