DEV Community

Discussion on: The Problem(s) with Nullable Reference Types

Collapse
 
gwigwam profile image
GWigWam • Edited

It seems the preferred way in the release version is to add:

<Nullable>enable</Nullable>

To your .csproj file.

Collapse
 
katnel20 profile image
Katie Nelson • Edited

Okay, because I have also seen;

<NullableReferenceTypes>true</NullableReferenceTypes>
Thread Thread
 
gwigwam profile image
GWigWam

During the previews of C# 8.0 that was the way to do it. In the release version however <Nullable> is preferred. For example, the official docs use it.

Thread Thread
 
katnel20 profile image
Katie Nelson

Thanks. That doc is 9 months old (before v3.0) I’ll give it a try.