I’m working with a code base that is currently using C# version 7.3 I am trying to set a nullable reference type however it throws an error and says this is not supported please upgrade to C# 8.
I was wondering if theirs any sort of backend workaround to this without needing to update the version
2
NRTs are a compiler feature, which requires C# 8 or greater – since that is when the feature first existed. However, the fact that you get this message (rather than just a confused syntax error) suggests that you might already have a more recent compiler, and it is being restricted by the project configuration – try using
<LangVersion>8</LangVersion>
(or above) in the csproj to hint at a later language version. In almost all cases, enabling a more recent compiler will not break existing code – although you might get a few messages suggesting that you try new features for your existing code. You can suppress these messages if you want a minimal impact update, and address those suggestions at a later date.