How to enable Nullable Reference Types feature of C# 8.0 for the whole project

前端 未结 6 1806
庸人自扰
庸人自扰 2020-12-05 03:44

According to the C# 8 announcement video the \"nullable reference types\" feature can be enabled for the whole project.

But how to enable it for the project? I did n

6条回答
  •  离开以前
    2020-12-05 04:25

    Note that this setting is changed between VS 2019 preview 1 and preview 2. With preview 2 or 3, you need this in your .csproj:

    
      8.0
      enable
    
    

    The mentioned in the earlier answer (which, when I originally wrote this answer on 4th Feb 2019, had been marked as the accepted answer) was correct at the time that answer was written, but it is no longer recognized.

提交回复
热议问题