4

I have a WCF running as a Windows service. I deployed it to a server (after quite a bit of banging my head against the keyboard).

Last issue: When making changes to the app.config (programname.exe.config in the service directory under program files), it obviously needs to be restarted.

Problem is this -- when I make a change to the config file and try to restart the service, it gives me the "Some services stop automatically if they have no work to do, for example...". I have to completely uninstall the service, re-install again, modify the config file, and THEN start the service.

This seems incredibly tedious and unnecessary. I think I should be able to simply edit the config file and restart. Is there a known conflict or setting I should be looking out for?

Thanks! -Jason

  • Have you checked the eventlog for exceptions? Do you have the ability to attach the debugger to see what's happening on restart? – ChristiaanV May 16 '11 at 18:36
  • Sadly, I cannot attach the debugger. But I will check the eventlog next time around. –  May 16 '11 at 18:48
  • Are you editing the .config file before or after stopping the service? I'm wondering if your service just fails to stop, regardless of if the config file is modified or not? – CodingWithSpike May 16 '11 at 19:25
  • I was editing the .config file before stopping the service -- I'm betting that was my issue. Thanks Rally! –  May 16 '11 at 23:01

3 Answers3

0

Just introduce a custom action dll hook into it from your msi.

The code in the dll (mangling a file for example) will get executed after the files have been copied yo disk but before the setup completes, i.e. before any service gets started.

PeteH
  • 2,394
  • 1
  • 20
  • 29
0

If it's a windows service you have to Install a fresh copy (after uninstalling previous one). I case of WCF services published over IIS you can make changes in the service build the project and then publish it. If some other application is already using your wcf services (endPoint) then no change is needed in that application and the new changed services can be consumed by new application without affection previous application.

user1675935
  • 121
  • 2
  • 11
0

You could try this instead.

  • Stop the service.
  • Modify the config file in development.
  • Re-deploy the project (say with Build -> Publish)
  • Start the service.
mellamokb
  • 56,094
  • 12
  • 110
  • 136
  • Thanks, but I can't publish. It's a windows service that has an install project with primary output and a project installer -- when I build it creates a Setup.msi and Setup.exe files which are distributed. Not publishable :-( I'm hoping to find a way to simple edit the config files, once installed, without going through a re-install process and especially without a re-build process. –  May 16 '11 at 18:53