I have a small sharepoint project that integrates into a larger sharepoint project. My project uses two web services. I added them using Web Reference(built-in to the Service Reference dialog box) in VS2010. We have two sets of web services: one for testing and one for production. When I deploy the application locally, the web service settings are written to the web.config file located C:\inetpub\wwwroot\wss\VirtualDirectories\80\on my local machine. The section looks something like this:
<applicationSettings>
<XXX.YYY.Properties.Settings>
<setting name="XXX_YYY_ZZZ_WS1" serializeAs="String">
<value>http://<TEST_IPAddress>/WebService/WS1.asmx</value>
</setting>
<setting name="XXX_YYY_ZZZ_WS2" serializeAs="String">
<value>http://<TEST_IPAddress>/WebService/WS2.asmx</value>
</setting>
</XXX.YYY.Properties.Settings>
</applicationSettings>
The difference between test and production web services is just the IP address. When I change the IP address to production, the application does not use the new values. I had to go back to VS, update Web Reference URLthe dialog box Propertiesto the correct production URLs, and then deploy the package again. This is tedious as I constantly switch from test to url web service. I want to be able to change the IP address in app.config, refresh the page in the browser and get new URLs.
Am I doing something wrong? Is there any other way to do this?
source
share