Quantcast
Channel: dynamically change web service url on a windows service using app.config - Stack Overflow
Viewing all articles
Browse latest Browse all 2

dynamically change web service url on a windows service using app.config

$
0
0

In my windows service I have 2 web references

My windows service only contains an app.config not a web.config

my app config looks like this:

<?xml version="1.0" encoding="utf-8" ?><configuration><configSections><sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"><section name="MyFirstWindowsService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /></sectionGroup></configSections><startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup><system.serviceModel><bindings /><client /></system.serviceModel><applicationSettings><MyFirstWindowsService.Properties.Settings><setting name="MyFirstWindowsService_postDataToMapicsWC_XAXSSTRN"                serializeAs="String"><value>http://TESTDEV/web/services/XAXSSTRN.XAXSSTRNHttpSoap11Endpoint/</value></setting><setting name="MyFirstWindowsService_com_goodmanmfg_testdev_GETITMINFO"                serializeAs="String"><value>http://TESTDEV/web/services/GETITMINFO.GETITMINFOHttpSoap11Endpoint/</value></setting></MyFirstWindowsService.Properties.Settings></applicationSettings></configuration>

[![enter image description here][1]][1]

the problem is my web services when i click on them the URL field is still saying

"Web reference URL"http://PROD/web/services/XAXSSTRN.XAXSSTRNHttpSoap11Endpoint[![enter image description here][2]][2]

what is the end goal? To release this windows service to dev and prod environments without having to rebuild the entire solution.

The ideal behavior is :

  1. Build the latest code in dev mode (test it, if all test good then , step 2)

  2. Provide an app.config file with prod urls to dropped inside thefolder

  3. Release

    As you can see what I am trying to avoid is the need of dropping the file manually changing those 2 web services , rebuilding the solution AND THEN releasing...


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>