You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to bind this to a TimeOnly, the result is always an Exception (or 00:00 depending on how it is read), while the result is 01:02 when binding to a TimeSpan.
at System.Runtime.CompilerServices.CastHelpers.Unbox(Void* toTypeHnd, Object obj)
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue[T](IConfiguration configuration, String key, T defaultValue)
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue[T](IConfiguration configuration, String key)
.NET Version
6.0.200-preview.21617.4
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.
Issue Details
Is there an existing issue for this?
I have searched the existing issues
Describe the bug
Having an appsettings.json that looks like this
{
"MyTime": "01:02"
}
When trying to bind this to a TimeOnly, the result is always an Exception (or 00:00 depending on how it is read), while the result is 01:02 when binding to a TimeSpan.
at System.Runtime.CompilerServices.CastHelpers.Unbox(Void* toTypeHnd, Object obj)
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue[T](IConfiguration configuration, String key, T defaultValue)
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetValue[T](IConfiguration configuration, String key)
Is there an existing issue for this?
Describe the bug
Having an appsettings.json that looks like this
When trying to bind this to a
TimeOnly
, the result is always an Exception (or00:00
depending on how it is read), while the result is01:02
when binding to a TimeSpan.Expected Behavior
The value can be bound to a TimeOnly instance.
Steps To Reproduce
Exceptions (if any)
It is a
System.NullReferenceException
Stack trace for the Exception:
.NET Version
6.0.200-preview.21617.4
Anything else?
No response
The text was updated successfully, but these errors were encountered: