I am struggling with how to configure the url to a web reference.
Here is the case. I have: old asp.net webservices <----- c# project that compiles to dll <----- website that references the dll (the c# project didn't used to be there but I refactored all that code into a seperate project)
So the website code calls the c# project's code to get results which in turn calls the webservice.
When adding a web reference in the c# project I entered the url location of the webservices (http://192.168.10.1/TestServices.asmx?wsdl. This then generates an app.config file containing the url of the webservices.
If I set the web reference to static than the config should not be used, that is working. Now if I set the web reference to dynamic, the config should be used but since this is a project being compiled to a dll, and the website does not have the app.config, instead I set the configuration from the app.config to my web.config appSettings node and I changed the url to the web services to another one (http://192.168.10.2/TestServices.asmx.
The website is still getting the result from the old url to which the web reference was pointed when adding it in the c# project so it looks like the config setting is not being used while the URL Behavious is set to Dynamic.
Am I missing something trivial here, probably?
This is the content from the app.config:
<applicationSettings>
<XXXX.Properties.Settings>
<setting name="XXXX_TestServices_TestServices" serializeAs="String">
<value>http://192.168.10.1/TestServices.asmx</value>
</setting>
</XXXX.Properties.Settings>
</applicationSettings>
This is what I put in my web.config:
<appSettings>
<add key="XXXX_TestServices_TestServices" value="http://192.168.10.2/TestServices.asmx" />
</appSettings>
So, now its always funny and informative/educational when during the typing of the question and double checking and search related question, you finally solve the question yourself.. I am posting it anyway with answer as I did not find the exact answer in one place but by combining 2 other questions and a blog post.