Non-nullable property must contain a non-null value when exiting constructor. Consider declaring the property as nullable

If you don’t want this, you can disable this by deleting the below line from the csproj file or setting it as disable. By default value is disable.

<Nullable>enable</Nullable>

Here is the official documentation.

Leave a Comment