После этого следующий код выдает предупреждение.
Код: Выделить всё
class Program
{
static void Main(string[] args)
{
string? message = "Hello World";
string message2 = null;
Console.WriteLine(message);
Console.WriteLine(message2);
// The annotation for nullable reference types should only be used in code within a '#nullable' context
}
}
Подробнее здесь: https://stackoverflow.com/questions/554 ... e-within-a