© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
❔ Non-nullable property 'Name' must contain a non-null value when exiting constructor - C#
C
C#
•
3y ago
•
10 replies
Jwan
❔ Non-nullable property 'Name' must contain a non-null value when exiting constructor
In the following class
, why do I get this warning and how do I make it happy
? I supposed I could make it like
string? Name
string? Name
but that isn
't really accurate because I can never have a PlayerModel where the Name is
null
null
. Same for
ImageUrl
ImageUrl
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
62,470
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
❔ Non-nullable property must contain a non-null value when exiting constructor
C
C# / help
3y ago
❔ Non-nullable field 'rating' must contain a non-null value when exiting constructor
C
C# / help
4y ago
✅ Help with non-nullable field must contain a non-null value when exiting constructor.
C
C# / help
4y ago
getting warning: CS8618 - Non-nullable variable must contain a non-null value when exiting construct
C
C# / help
3y ago