tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Easier nullable reference types errors instead of warnings

24 Aug 2022 1 mins C#, MSBuild, Roslyn

Three years ago (yes, I looked it up), I wrote a blog post about switching from warnings in NRT to errors. But it required manually adding codes for all the warnings (luckily thanks to Roslyn being open source, it’s not that difficult) and keeping that list up to date. But recently I found much simpler way.

Now, at least with C# 10 and VS 2022, you can simply use <WarningsAsErrors>nullable</WarningsAsErrors> instead of <WarningsAsErrors>CS8600;CS8602;CS8603;...</WarningsAsErrors>.

<WarningsAsErrors>nullable</WarningsAsErrors>

This is much easier to setup and maintain.

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.