We have a project that targets netstandard2.0 and that project uses the NuGet package CsvHelper, that is also available as netstandard2.0.
This project contains the class CsvConfiguration that is build as:
public class CsvConfiguration
{
public virtual string Delimiter { get; init; }
}
And we use this library without any problems in the past. After updating Visual Studio from 16.8.6 to 16.9.0 the above mentioned error message occurs on a build:
error CS8370: Feature 'init-only setters' is not available in C# 7.3. Please use language version 9.0 or greater.
While I understand why this error would occur, if I would use this feature in my own code, I don't know why this happens if a third party library uses it, that is declared to match my framework version.
Is this a bug in the library or in Visual Studio? Cause in VS 16.8.6 it compiles fine and in VS 16.9.0 it fails.
I know, an easy workaround would be to add a <LangVersion> entry within our .csproj file, but is this the recommended way?