© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
3y ago
•
7 replies
Davide
❔ IOptions pattern in WebAPI getting null value
I
'm trying to use the IOptions pattern with Dep
. Injection
, however when i debug the code i get null values in the injected object
.
I
've tried to use the
.AddOptions()
.AddOptions()
method to the
builder
builder
ServiceCollection
ServiceCollection
but still i get null values
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
Populating IOptions in integration tests
C
C# / help
3mo ago
getting null error
C
C# / help
3y ago
Dependency Injection returning null value
C
C# / help
15mo ago
✅ Library is a null value
C
C# / help
2y ago