Windows service app.config location

前端 未结 6 1721
傲寒
傲寒 2020-12-04 16:26

I have installed a C# Windows Service on Windows Server 2008. I installed it with InstallUtil. The service reads some data from the app.config file and it is doing it fine.

6条回答
  •  渐次进展
    2020-12-04 17:17

    According to Microsoft

    For client executables, the application configuration file resides in the same directory as the application's executable and has the same base name as the executable with a .config extension.

    Note, if your exe is called appname.exe, and you have Windows explorer set to hide extensions, then your application will display as appname and your config file then it will be displayed as appname.exe (even though the true name is appname.exe.config)

    As others have pointed out, InstallUtil doesn't do anything with the config file and it should have copied to the server in the same manner as the exe itself.

提交回复
热议问题