我有两个在同一个解决方案下的项目。我想要更改一个项目的app.config的值,但我不知道该如何做。
项目A
项目B
它们应该这样运行:
项目A是一个CodedUITest,我想要更改它配置文件中的一个值。
这是我的尝试方式:
这是我的尝试方式:
string abc = @"absolutePath\app.config";
Configuration configuration = ConfigurationManager.OpenExeConfiguration(abc);
configuration.AppSettings.Settings["areaCode"].Value = "new";
configuration.Save();
ConfigurationManager.RefreshSection("appSettings");
我希望修改的项目 app.config 是一个 .dll(codedUiTestProject)。
这是我的节点结构:
<appSettings>
<add key="LogFilePath" value="" />
<add key="areaCode" value="steamAccessDummy"/>
</appSettings>
我需要一些帮助,谢谢!还有其他解决方案吗?