0
C# Visual Studio 2010에서 DLL 응용 프로그램 설정을 읽는 데 문제가 있습니다. ConfigurationManager가 실패하여 리플렉션을 사용하여 get workarounded의 샘플 코드를 게시합니다.DLL app.setting에서 문제가 발생했습니다.
private string LDAPDomain
{
get
{
string strPath = System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
string val = GetValues(strPath, "LDAPDomain");
return val;
}
}
//strPath is path of the file.
//strKey is key to access
private string GetValues(string strPath, string strKey)
{
System.Configuration.Configuration con = System.Configuration.ConfigurationManager.OpenExeConfiguration(strPath);
string strValue = con.AppSettings.Settings[strKey].Value;
return strValue;
}
문제를 해결하지 못했습니다. –
@SimoneSpagna 일부 컨텍스트가 도움이 될 것입니다 ... – James