0

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 read from correct config.

How to read from app.dll.config file?

Vajda
  • 1,795
  • 6
  • 39
  • 49

1 Answers1

1

You can use ConfigurationManager's OpenExeConfiguration(string) method:

http://msdn.microsoft.com/en-us/library/ms224437.aspx

heisenberg
  • 9,665
  • 1
  • 30
  • 38