WCF as a service: modifying the app.config file

I have WCF running as a windows service. I deployed it to the server (after I hit my head a bit on the keyboard).

The last problem: when making changes to app.config (programname.exe.config in the service directory in the program files), it obviously needs to be restarted.

The problem is that when I make changes to the configuration file and try to restart the service, it gives me "Some services automatically stop if they have no work, for example ...". I have to completely remove the service, install it again, change the configuration file, and then start the service.

It seems incredibly tedious and unnecessary. I think I just need to edit the configuration file and restart. Is there a known conflict or attitude that I should look at?

Thanks! Jason

+4
source share
3 answers

You can try it instead.

  • Stop the service.
  • Modify the configuration file during development.
  • Redeploy the project (say using Build -> Publish)
  • Start the service.
0
source

Just enter in it an arbitrary dll action from your msi.

The code in the dll (for example, to distort the file) will be executed after the files are copied to disk, but before the installation is completed, that is, before starting any service.

0
source

If it is a Windows service, you need to install a new copy (after deleting the previous one). For WCF services published through IIS, you can make changes to the service, build the project, and then publish it. If any other application already uses your wcf (endPoint) services, no changes are required in this application, and new changed services can be used by the new application without binding the previous application.

0
source

All Articles