Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Configuration.GetSection(String) returns description is incorrect #10754

Open
rbennett10 opened this issue Dec 12, 2024 · 3 comments
Open
Labels
area-System.Configuration Pri3 Indicates issues/PRs that are low priority untriaged New issue has not been triaged by the area owner

Comments

@rbennett10
Copy link

Describe the issue or suggestion

The current returns description of GetSection() indicates that it returns null. That is incorrect.

The specified ConfigurationSection object, or null if the requested section does not exist.

The return type is not marked as nullable in the source code:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Configuration.cs#L165

public ConfigurationSection GetSection(string sectionName)

In the ASP.NET Core docs it correctly states "GetSection never returns null":
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/configuration/index.md?plain=1#L705

GetSection never returns null. If a matching section isn't found, an empty IConfigurationSection is returned.

The correction should be made here:
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Configuration/Configuration.xml#L356

@issues-automation issues-automation bot added the Pri3 Indicates issues/PRs that are low priority label Dec 12, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 12, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 12, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@CarnaViire CarnaViire added area-System.Configuration and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Dec 17, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Configuration Pri3 Indicates issues/PRs that are low priority untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants