-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JsonConstructorAttribute not working for private/internal ctor in .NET 8.0 preview7 #90577
Comments
Hi @TanvirArjel, would it be possible to share your reproduction in text? It's difficult to transcribe using screenshots. |
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsDescriptionHello @eiriktsarpalis, I have tested with .NET 8.0 Preview7 SDK with Rider. It's not working. It's throwing the following exception: My SDKs: Debug Log: Employee class: Reproduction StepsTry in Rider with .NET 8.0 preview 7 SDK. Expected behaviorIt should have worked as mentioned here: #88452 Actual behaviorNot working. Throwing Unsupported exception. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
The exception message says "parameterless constructor, a singular parameterized constructor or a parameterized constructor annotated with 'JsonConstructorAttribute'".
|
@eiriktsarpalis Here it is: The Program class:
The employee class:
|
@huoyaoyuan For |
Right, sometimes it can't be determined and needs to be specified. |
@huoyaoyuan Primary need of |
Appears to be a bug specific to applying the attribute to parameterless constructors. We should fix this. |
Description
Hello @eiriktsarpalis,
I have tested with .NET 8.0 Preview7 SDK with Rider. It's not working. It's throwing the following exception:
My SDKs:
Debug Log:
Employee class:
Reproduction Steps
Try in Rider with .NET 8.0 preview 7 SDK.
Expected behavior
It should have worked as mentioned here: #88452
Actual behavior
Not working. Throwing Unsupported exception.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: