C# Nullable Context

We had an older project that we are updating to C#11 and .NET 7.0 and noticed that the nullable compiler warnings were not showing. These are turned on in new projects (C#8.0 and above in VS2022 etc) by default.

But if you load an older project and look in the project properties, you will see the dropdown empty:

Select ‘Enable’ in this setting and the compiler warning will show. For example:

Posted in Knowledge Base and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *