© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago
voltagex

System.CommandLine and injection of IOptions (not Option!) type

I'm trying to work out how to use the hosting and dependency injection parts of System.CommandLine to inject IOptions configuration settings into my app via the command line. See https://github.com/dotnet/command-line-api/issues/1858#issuecomment-1254653273. Short version: how can I make System.CommandLine binding or dependency injection work to change the value of a typed IOptions instance?
GitHub
Dependency injection confusion - How to use CommandLineBuilder, Use...
I'm lost in the weeds with dependency injection here. using System.CommandLine; using System.CommandLine.Builder; using System.CommandLine.Hosting; using System.CommandLine.Invocation; usin...
Dependency injection confusion - How to use CommandLineBuilder, Use...
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

❔ Default command in System.CommandLine
C#CC# / help
3y ago
✅ System.CommandLine -> How to create a option without a parameter?
C#CC# / help
3y ago
✅ Allowing option of using dependency injection
C#CC# / help
3y ago
[System.Commandline] how to exit on --help
C#CC# / help
3y ago