Windows 服务多语言化时读取配置文件失败的问题。

在Installer中,按一般读取配置文件的方法(ConfigurationManager.AppSettings["CultureName"])读取不到内容.

可以这样读取:

var config = ConfigurationManager.OpenExeConfiguration(Assembly.GetAssembly(typeof(ProjectInstaller)).Location);
string cultureName = config.AppSettings.Settings["CultureName"].Value;

posted @ 2016-03-28 17:04  山的女儿  Views(1043)  Comments(0)    收藏  举报