0

I have appsettings.json in my ASP.NET Core Web API with key and value and it works perfectly:

enter image description here

But, when I want use ConfigurationManager to get value in MSTEST's method, I always get NULL:

enter image description here

Please, help me, how can I get the correct value?

Thanks a lot

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

1

Your WebApi and Tests are two different projects. The App.config file is set up for the WebApi.

You can look into this answer about setting up one config file for multiple projects: Single App config multi project C#

Etheraex
  • 508
  • 6
  • 17