0

I have a website that uses a class project, and the website has a Web Reference, which has a dynamic URL based on the web.config file - so in develoment, it's http://localhost:2880/service.asmx and on live it's http://www.example.com/service.asmx

I've added a console application that needs to share functionality from the website, so I've moved the Web Reference into the class project, and put the web.config (appsettings) line into the app.config. All works fine on localhost, but it doesn't override the web service Url on live.

If I create the Web Reference in the console application, it also works fine - dynamic Url and all. So it seems in a class project / .dll, since there is no "native" config file, it can't use the appropriate config file, and so you can't have the dynamic Url.

Can anyone confirm this or provide a solution?

Sean
  • 14,359
  • 13
  • 74
  • 124

1 Answers1

0

Silly me. Adding the web reference to the DLL project created an App.config file in that project, with the Url in there, so it was obviously using that config file and not looking in the website/other projects config file.

Sean
  • 14,359
  • 13
  • 74
  • 124