【发布时间】:2014-03-01 11:22:13
【问题描述】:
我正在使用 app.config 做一个 Windows 服务,其中有一个部分可以检索另一个文件中的通用配置。使用
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "filepath\\file");
对我有用,但使用
string appconfig = ConfigurationManager.AppSettings["CommonAppSetting"];
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", appconfig);
没有。它来自windows服务的app.config,而不是通用配置。
我做错了什么,或者有其他更好的方法吗?
【问题讨论】:
标签: windows-services app-config