Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Unable to resolve injected configuration

$
0
0

Only in the master branch in our project, a specific service injected in Startup does not resolve when calling a specific controller.The injected "Service" is just a class with statics filled with configuration values.

In Startup.cs:

var azureAdConfiguration = Configuration.GetSection("AzureAD").Get<AzureAdConfiguration>();services.AddSingleton<IAzureAdConfiguration>(azureAdConfiguration);

In the specific controller:

private readonly IAzureAdConfiguration _azureAdConfiguration;public Controller(IConfiguration configuration, IAzureAdConfiguration azureAdConfiguration)    {        _configuration = configuration;        _azureAdConfiguration = azureAdConfiguration;    }

I have debugged startup, and the azureAdConfiguration object is properly filled from configuration.What am i missing here? Why won't this resolve?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>