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
{{ message }}
Repository navigation
System.Text.Json does not support constructors with byref parameters. #46088
Looks like System.Text.Json doesn't understand byrefs as ctor arguments? You can work around this for now by removing the in keyword from your ctor parameters.
changed the title [-]System.Text.Json argument exception: The type 'System.DateTime&' may not be used as a type argument.[/-][+]System.Text.Json does not support constructors with byref parameters.[/+]on Aug 2, 2022
Activity
Dotnet-GitSync-Bot commentedon Dec 15, 2020
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.
GrabYourPitchforks commentedon Dec 16, 2020
Looks like System.Text.Json doesn't understand byrefs as ctor arguments? You can work around this for now by removing the
inkeyword from your ctor parameters.ilanb1996 commentedon Apr 18, 2021
Hi @GrabYourPitchforks
Im looking for an issue to take as my fist contribution and stumbled upon this issue.
Do you think its ok if i take it on me?
GrabYourPitchforks commentedon Apr 18, 2021
@layomia - thoughts?
layomia commentedon Apr 19, 2021
@GrabYourPitchforks, @ilanb1996 sounds good, thanks! I'll assign the issue to you - please tag me with any questions.
19 remaining items
ViktorHofer commentedon Jun 14, 2021
eiriktsarpalis commentedon Oct 22, 2021
Out of curiosity, what should be our expected approach to fixing this? I presume the error occurs when attempting to instantiate
SmallObjectWithParameterizedConstructorConverter<>withDateTime&as a type parameter. Presumably we'd have to fall back to LargeObjectWithParameterizedConstructorConverterWithReflection?[-]System.Text.Json argument exception: The type 'System.DateTime&' may not be used as a type argument.[/-][+]System.Text.Json does not support constructors with byref parameters.[/+]eiriktsarpalis commentedon Aug 5, 2022
Once we address this issue we should make sure to re-enable the following disabled test:
runtime/src/libraries/System.Text.Json/tests/Common/ConstructorTests/ConstructorTests.ParameterMatching.cs
Lines 1295 to 1301 in 1a0c9ca
Support constructors with byref parameters (in/ref/out) in System.Tex…