C
C#7mo ago
NDOT

✅ Configurations say that appsettings is returning null

Basically, i have a configuration and i'm trying to access a value from my appsettings, and all that i got is "null", but the value is actually there, more details below
2 Replies
NDOT
NDOTOP7mo ago
that's my appsettings :
{
"ClientId": 0,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
{
"ClientId": 0,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
and that's how i'm trying to access it :
if (int.TryParse(_configuration["ClientId"], out clientId))
if (int.TryParse(_configuration["ClientId"], out clientId))
it returns null from it anything that i'm doing extremely wrong ?
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server