I have a C# library which needs to reference 2 Web Services, one when the site is in “Stage” and then point to another when in “Production”. How can I set up different URLs for the web service? I noticed that the URL is hard coded in the .disco file. Is there way to do this dynamical set this? I also tried this solution:
App.Config Transformation for projects which are not Web Projects in Visual Studio 2010?
But for some reason when I compile my web site, the library is compiled but the app config does not get copied to the bin folder. So I am assuming my Web Service URLS are hard coded in the library dll. Any help is greatly appreciated.
Thanks
a little bit more info may be needed, but here’s what I can tell you early on:
you can always set your server (host) to “offer” two different endpoints for the same exact service, that is configurable from visual studio with your WCF configuration option.
If you mean to “point” to different urls that have the same web service definition, then you just need to instantiate the proxy that you created when adding the web reference, and in the constructor you provide the other url you are using in production.
Your web config usually is copied to your bin folder, maybe you should check your deployment installation process. or try to add it yourself.