It depends on how the WIN Service app reads the connectionString from
app.config. If you let the service read app.config at startup only, then you
need to stop and restart the service once the app.config is changed. This is
the common approach. As the developer of the Service, you do know when the
service app reads the settings in app.config, don't you? The best thing to
do is to make sure the ConnectioNString is correct before installing the Win
service in a production box.
If for some reasons that your service can never be stopped once started,
then you could code the service to read the ConnectionString setting in
app.config periodically to see if change has been made, if yes, use the
newly read ConnectionString. However, I doubt its necessity, although it is
technically doable.
"Bill Mild" <wm***@community.nospamwrote in message
news:33**********************************@microsof t.com...
Feel free to let me know if there is a better place to post this question
I'm a website developer trying to write a Windows Service, and I think I'm
running into trouble due to the paradigm shift.
In website development, I change the web.config file on the fly without
re-building a project. How does this work with the app.config in a
Windows
Service? It seems like when I update a ConnectionString in app.config
after
rolling to a production server, it doesn't take. Does app.config get
complied into the executable on build so that I can't change it on the
fly?
If so, how would I set it up to be able to configure the db connection
string
on the production server?
Thanks.