.NET服务配置文件位置配置文件、位置、NET

2023-09-07 08:55:48 作者:未来有诗和远方

样的一个愚蠢的问卷,但有人可以点我到了一个基于.NET的Windows服务配置文件被放在哪里?我使用 installutil 安装的服务,它能够从它的配置文件蛮好看,但搜索的磁盘没有透露安装文件在哪里至。

Kind of a silly question- but can someone point me to where the config file for a .NET-based Windows service gets placed? I'm using installutil to install the service, and it's able to read from its config file just fine, but a search of the disk hasn't revealed where the file was installed to.

我需要知道,因为我要编辑配置文件,而无需重新安装服务。

I need to know because I want to edit the config file without reinstalling the service.

推荐答案

installutil不动的组件。所以,如果你在运行C installutil:\富\酒吧\ MyService.exe,它会从C读取配置:\富\酒吧\ MyService.exe.config

installutil doesn't move the assembly. So if you run installutil on C:\Foo\Bar\MyService.exe, it's going to read the configuration from C:\Foo\Bar\MyService.exe.config.

当然,你必须改变配置后重新启动该服务。应该不需要重新安装它,但。

Of course, you'll have to restart the service after changing the config. Shouldn't need to reinstall it, though.

 
精彩推荐