-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Milestone
Description
Description
When using a metaDataLoadContext to find static methods in an assembly, invoking ParameterInfo.RawDefaultValue
throws a badformat exception - I've tracked down the line of code to here:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Ecma/EcmaDefaultValueProcessing.cs#L18
this appears to throw when the parameter in question is an optional string with a default value of empty string ""
It looks like constantValue.Value
is nil in this case. I'm not sure if it's simply an issue with empty strings in all cases or its an environment issue.
Configuration
- Which version of .NET is the code running on?
.net 4.8
- What OS and version, and what distro if applicable?
windows 10 2004
- What is the architecture (x64, x86, ARM, ARM64)?
x64
- Do you know whether it is specific to that configuration?
do not know
- If you're using Blazor, which web browser(s) do you see this issue in?
NA
Regression?
Don't know at this time.