You can verify the exact location of the installed Windows Service by following the steps below:
Bring up the list of Windows Services by clicking the "Services" icon under the "Administrative Tools" icon. You can also get this list by typing "View local services" in the Search Menu under the Start Menu.
Select your Windows service in the list of installed services, right-click and then select Properties. You can also double click on row representing the service.
Locate the "Path to executable" value on the Properties dialog box. The value will include any command line parameters.
Open the folder in which the service executable resides.
If the Windows service has been built with .NET Framework, its configuration will be stored in the corresponding .config file, i.e., the name of the executable suffixed by ".config", e.g., if the name of the executable is "XyzService.exe", then the name of the .config file will be "XyzService.exe.config".
A couple of things to note:
If you installed the service after building it on the same machine using say, Visual Studio, then Visual Studio would have transformed the App.config file from the project and placed it in the build output folder automatically (and renamed it appropriately using the above naming convention).
If your machine is set to hide file extensions in Windows Explorer, you will see 2 files "XyzService" and "XyzService.exe". In this case, the "XyzService.exe" is your config file. If you then switch off the option to hide file extenions in Windows Explorer, you will then begin to see "XyzService.exe" and "XyzService.exe.config".
If you cannot find a corresponding .exe.config file, then it is possible that the code within the service is falling back to default values. In this case, you can place a properly named and formatted config file alongside the service executable and then restart the service and everything should be fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…