简体   繁体   English

可以为生成的进程修改app.config吗?

[英]Can app.config be modified for spawned processes?

Here's what I want to do: build a .net console application with an app.config file. 这是我要执行的操作:使用app.config文件构建.net控制台应用程序。 Then, from a second application, spawn instances of the console application, which each instance having some attributes of it's app.config settings tweaked. 然后,从第二个应用程序中生成控制台应用程序的实例,每个实例都对其app.config设置的某些属性进行了调整。

So far I've figured that this can be done if the binary is copied and renamed each time I spawn the process, since each binary looks for an app.config file with a matching name. 到目前为止,我已经知道,如果每次生成该进程时都复制并重命名二进制文件,则可以完成此操作,因为每个二进制文件都在查找具有匹配名称的app.config文件。 But I'd prefer to do this with a single exe and config file. 但我更愿意使用单个exe和配置文件来执行此操作。

使用命令行参数在同一app.config中选择配置值...您可以使用ProcessInfo使用附加参数从.Net生成进程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM