docs icon indicating copy to clipboard operation
docs copied to clipboard

Question

Open mcurko opened this issue 5 years ago • 3 comments

I tested all the examples you provided (NET5, newest VS), and didn't get any compilation warnings you described.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mcurko avatar Jun 25 '21 10:06 mcurko

@mcurko Can you check you have enabled nullable reference types? You need to do that both in the file containing Person class (the code in article already has #nullable enable), and also at the top of the test file and the file containing your main method.

Alternatively, you can do that in csproj or Directory.Build.props like the following:

<PropertyGroup>
  <Nullable>enable</Nullable>
</PropertyGroup>

I think the point of confusion here is that the article isn't super clear about that. Please confirm.

Youssef1313 avatar Jun 25 '21 15:06 Youssef1313

This issue has been automatically closed due to no response from the original author. Please feel free to reopen it if you have more information that can help us investigate the issue further.

no-response[bot] avatar Jul 12 '21 17:07 no-response[bot]