C
C#2y ago
danno8524

❔ Access AppSettings from CSHTML in ASP.NET core

I am trying to read from my AppSettings.json file but am getting undefined returned. What am I missing here?
6 Replies
KidKai25
KidKai252y ago
try and check getting AppSettings.json file first.
danno8524
danno8524OP2y ago
not sure what you mean...
KidKai25
KidKai252y ago
I meant before using GetSection, just try to see you are even getting the appsetting.json file. I don't know how it works but just trying to tell you a way to debug. Apologies if not of much use.
danno8524
danno8524OP2y ago
What would be the syntax for that?
friedice
friedice2y ago
weird, that should work. Is Configuration injected properly?
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server