© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#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
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Populating IOptions in integration tests
C#CC# / help
3mo ago
getting null error
C#CC# / help
3y ago
Dependency Injection returning null value
C#CC# / help
15mo ago
✅ Library is a null value
C#CC# / help
2y ago