how to monitor the Status of the windows service ?
-
Hi, how to monitor the status of the service from a utility developed in c#,I came to know that we can use either System.ServiceProcess.ServiceController class or WMI.Which is more robust,and feasible way.....I have to start,Stop and pause a service ,the App.config file has settings like polling time...I am not able to modify the service during runtime if i make change to the App.config after installing the service.So is it Feasible to modify the Application.exe.config file during runtime to make the changes take effect during runtime...
-
Hi, how to monitor the status of the service from a utility developed in c#,I came to know that we can use either System.ServiceProcess.ServiceController class or WMI.Which is more robust,and feasible way.....I have to start,Stop and pause a service ,the App.config file has settings like polling time...I am not able to modify the service during runtime if i make change to the App.config after installing the service.So is it Feasible to modify the Application.exe.config file during runtime to make the changes take effect during runtime...
Unless you are doing something custom your windows service will load the app.config on start. You can make changes to the app.config while the window service is running, but they will not take affect until the service is stopped and re-started. If you have some custom code that re-reads the app.config file every time, then you might be able to get that to work. Otherwise you will need to stop and restart the service. Ben
-
Unless you are doing something custom your windows service will load the app.config on start. You can make changes to the app.config while the window service is running, but they will not take affect until the service is stopped and re-started. If you have some custom code that re-reads the app.config file every time, then you might be able to get that to work. Otherwise you will need to stop and restart the service. Ben
-
hi, The changes made in the App.config will not take effect even ater stopping and starting the service , not untill you recompile the solution....
people laugh at me because they say im different and I laugh at them because they are all the same.
No that is not true. When you stop the service and start it again the app.config is read again. Now if you mean literally that if you make changes to the app.config file, then yes you need to recompile. But you should be changing the programname.exe.config file. where programname is replaced with what ever you call your service. When you change that file and stop and start the service it will pick up the change. Just make sure you update the app.config in your project as well. Ben
-
No that is not true. When you stop the service and start it again the app.config is read again. Now if you mean literally that if you make changes to the app.config file, then yes you need to recompile. But you should be changing the programname.exe.config file. where programname is replaced with what ever you call your service. When you change that file and stop and start the service it will pick up the change. Just make sure you update the app.config in your project as well. Ben
Thanks, After the service is installed it is not going to be recompiled in any way..So why do i at all make changes to the App.config file...Please clarify..
people laugh at me because they say im different and I laugh at them because they are all the same.
-
Thanks, After the service is installed it is not going to be recompiled in any way..So why do i at all make changes to the App.config file...Please clarify..
people laugh at me because they say im different and I laugh at them because they are all the same.
When you install your service, you need to have at least two files. One is the exe file. The other is the exe.config file. The exe.config file is created when you compile your project from the app.config. You can update the exe.config file directly and stop and start the service and it will use the new config settings. So if you service is called MyService the exe would be MyService.exe and the config file would be MyService.exe.config. Hope that helps. Ben