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

ArgumentNullException when using a minimal Json file with the JsonConfigurationProvider #41117

Closed
BrennanConroy opened this issue Aug 20, 2020 · 3 comments · Fixed by #41428
Closed

Comments

@BrennanConroy
Copy link
Member

BrennanConroy commented Aug 20, 2020

Description

Using a minimal Json file {}
with the JsonConfigurationProvider fails with:

System.ArgumentNullException : Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.SortedDictionary`2.set_Item(TKey key, TValue value)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.VisitElement(JsonElement element)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream input)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.Parse(Stream input)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
--- End of stack trace from previous location ---
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()

This is because _currentPath will be null and try to set the null to null in the new code path.

Regression?

Yes, caused by #40829

cc @maryamariyan

This is blocking the Runtime -> AspNetCore dependency update. We can skip our failing tests to workaround, but ideally this will be fixed ASAP.

@Dotnet-GitSync-Bot
Copy link
Collaborator

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-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Aug 20, 2020
@ghost
Copy link

ghost commented Aug 20, 2020

Tagging subscribers to this area: @maryamariyan
See info in area-owners.md if you want to be subscribed.

@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label Aug 27, 2020
@maryamariyan maryamariyan added this to the 5.0.0 milestone Aug 27, 2020
@maryamariyan
Copy link
Member

maryamariyan commented Aug 27, 2020

got a repro.. working on it.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants