© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
2y ago
•
11 replies
Core
Is there a method that throws an exception if a config value is not present in appsettings?
Hello
,
Getting configuration values from
appsettings.json
appsettings.json
is done via calling
builder.Configuration["name"]
builder.Configuration["name"]
. This way few of my services might get a null property
, without throwing error before build
.
Is there an existing method that will throw an exception if the config value is
null
null
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
✅ Check if value is within range, throw exception if not
C
C# / help
16mo ago
✅ async Task throws exception if not explicitly defined
C
C# / help
3y ago
✅ Is throwing and catching an exception in an UnmanagedCallersOnly method valid?
C
C# / help
9mo ago
✅ JSON serializing Optional type throws an exception(?)
C
C# / help
3y ago