✅ Non-nullable property netstandard2.0
Hello,
In new .NET versions there's the
required
keyword for this warning, but what's the best way to solve this if not possible?
Recently allowed a library to support older .NET versions, and I have no idea what's the preferred way to resolve this.
20 Replies
try setting LangVersion to 11.0 or higher
it is set to latest
Oh it actually works
Great

It doesn't afterall
it's just attributes, so could include them manually
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
you mean netstandard 2? Shouldk I completely ditch it?
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
this one not, but the next one will be
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Got it, most open source propejcts support these, and that's why I was trying it out
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Is netstandard 2.1 only used by unity?

Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
yeah I diteched it
Thanks for the details
How does this work? I get that it will enable all the new syntaxes that are possible in newer .NET versions, like nullable types, required properties, etc.
But what happens after building the package, and
required
was used? Will it simply be omitted in the compiled executable?required is only an attribute
as i understand it roslyn only looks for specific attributes, and it doesn't matter where they are defined
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
Great, I read the wiki, but I still couldn't entirely understand how it works
Thank you again for helping me
$close
If you have no further questions, please use /close to mark the forum thread as answered