C
C#13mo ago
DaVinki

❔ Does the C# version matter for a netstandard2.1 library?

Title
8 Replies
jcotton42
jcotton4213mo ago
in general you can use the latest version, though some features like static abstracts may be unavailable for an ns2.1 target
jcotton42
jcotton4213mo ago
other features like required members will be unavailable due to missing types, but can be polyfilled with libraries like https://github.com/Sergio0694/PolySharp
GitHub
GitHub - Sergio0694/PolySharp: PolySharp provides generated, source...
PolySharp provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. Add a reference, set your C# version to latest and have fun! 🚀 -...
vdvman1
vdvman113mo ago
Yeah you need to be careful not to use any language features that require runtime changes, but otherwise it should work fine
DaVinki
DaVinki13mo ago
Alright, thank you guys
jcotton42
jcotton4213mo ago
the compiler will refuse to compile in that case I believe
vdvman1
vdvman113mo ago
Most likely, yeah, but still something to keep in mind just in case
JakenVeina
JakenVeina13mo ago
Nah, it definitely does, you get a compile error stating "Runtime Type XXXX not found" for whatever types were missing. Happens to me all the time. there haven't been any breaking runtime changes since, like, C#5 or 6? Only new built-in types being added.
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts