I am looking at and following example code that has the following lines:
public static DispenseOptionSketchVolume DoSketchVolume = new();
public static SketchSettingsPageData SketchSettingsPageData = new();
public static BlockVolumeData BlockVolumeData = new();
public static SketchEntityVolumePage SketchEntityVolume = new();
In my own project I created a framework 4.8 class library but get the error:
Feature 'target typed object creation' is not available. Please use language version 9.0 or greater.
new();
is the error.
If I add this to my own csproj:
<PropertyGroup>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
Visual Studio asks me to attach to a process:
In the example project the framework is set to 4.8, the type is a class Library, there is a framework that automatically registers the dll and it runs. There is no <LangVersion>
directive in any file csproj or otherwise.
How could the example project compile the = new();
statements?