开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜