-
-
Notifications
You must be signed in to change notification settings - Fork 66
Description
We produce SDKs and love PolySharp for offering modern .NET/C# features to the end users, but some users have reported they cannot use the SDK's we produce.
The SDKs we generate are compatible with .NET Framework 4.6.2, .NET Standard 2.0, and in support .NET Core versions.
When we ran into this issue with init, we decided to simply stop using init as everyone using versions before C# 9 was blocked by this, regardless of compiler version. This wasn't a deal breaker for us.
Now a much smaller set of users are running into issues when setting required properties from our libraries. The amount of users running into this is smaller because only older compiler versions are struggling with this.
The error the users see is this:
Constructor 'Foo.Foo()' is obsolete: 'Constructors of types with required members are not supported in this version of your compiler.'
I can reproduce this when using the latest mono to compile a .NET framework project that consumes this library we generate.
I can also reproduce this on Windows by setting the compiler to the one from .NET 4 form the csproj:
<CscToolPath>C:\Windows\Microsoft.NET\Framework\v4.0.30319</CscToolPath>
I assume the answer is they're out of luck, and they need to use more recent compilers, or we conditionally do not use required for the .NET framework.
I don't think we want to do the latter since a lot of .NET framework users are benefiting from the required keyword without issues.
I thought it's worth asking so we can better understand the limitations and respond to customers better.