Reading specific config file
I made my custom configuration classes to parse data from my config section. My project is class library which means it creates dll. I found this way to retrieve my config section:
return (ReportServerConfigurationSection)ConfigurationManager.GetSection(sectionGroup + "/" + sectionName);
But this only works for .exe applications. I waned to test my dll with specific config in some integration test but I cannot manage to r开发者_如何学Pythonead from correct config.
How to read from app.dll.config file?
You can use ConfigurationManager's OpenExeConfiguration(string) method:
http://msdn.microsoft.com/en-us/library/ms224437.aspx
精彩评论