Reading app.config in a class library

I have a class library and I would like to have some configurations stored in App.config that will be placed in the same project. I tried reading the configuration using:

ConfigurationManager.AppSettings ["ABC"];

and it does not bring me any meaning.

It would be great if you could tell me how I can read my App.config. I do not want to do this with xml. It would be great if you could post code samples in C #.

Thank you in advance

+3
source share
2 answers

App.config . app.config . , ConfigurationManager.AppSettings["ABC"]; , /web.config , .

+3

, app.config( web.config) .

NUnit app.config , *.nunit. , "ClassLibraryA.nunit", "ClassLibraryA.config". /. NUnit

.... System.Configuration( .NET)

.... :

string settingValue = ConfigurationManager.AppSettings["settingName"];
+1