© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
6 replies
GNUGradyn

How do I check if a list in an IConfiguration has any values [Answered]

I am trying to do this
if (_config.GetValue<bool>("AutoRegisterSlashCommands:Dev") && _config.GetSection("DevServers").Get<ulong[]>().Any())
if (_config.GetValue<bool>("AutoRegisterSlashCommands:Dev") && _config.GetSection("DevServers").Get<ulong[]>().Any())


However this throws an ArgumentNullException if the configuration section is an empty list
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

✅ Check if an item is in a list
C#CC# / help
2y ago
❔ How can I check if any element of a list is in another list?
C#CC# / help
4y ago
how do i print an arraylist [Answered]
C#CC# / help
4y ago