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
Having required members together with circular reference serialization causes CS9035 (required member must be set in the object initializer or attribute constructor) compilation error in generated file. The issue present only if GenerateType is CircularReference.
The text was updated successfully, but these errors were encountered:
ardabada
changed the title
Having required members with circular reference causes CS9035
Required members with circular reference causes CS9035
Feb 7, 2025
Having required members together with circular reference serialization causes CS9035 (required member must be set in the object initializer or attribute constructor) compilation error in generated file. The issue present only if
GenerateType
isCircularReference
.Reproduction Steps
Expected behavior
Source generated file compiles as expected.
Workaround
Remove
required
keyword and use null-forgiving operator where needed:The text was updated successfully, but these errors were encountered: