0

I am developing in C #, I opened a Class Library project to for to get DLL. I have a problem when I add app.config manually , when i get the value from a config, the value is null, its mean, the code does not recognize the config file I turn config as usual. And get NULL;

string test = ConfigurationManager.AppSettings["Test"];

thank you for your help

user1817661
  • 83
  • 1
  • 6
  • Visual Studio just adds an app.config to a class library project for development purposes. The app.config of the _executing_ project is always used at run-time. – D Stanley Oct 28 '15 at 20:05
  • If you need your `app.Config` of testing, try to add a testing project and there add an `app.Config`file. If not the case, you could have `configuration` class to read values from `ConfigurationManager` but the .config file needs always to be in a test project or a console project. – mijail Oct 28 '15 at 20:10

0 Answers0