Symptom

When compiling PowerScript Migrator translated code, you may see the compile error CS8107 in Output:

Feature 'readonly references' is not available in C# 7.0. Please use language version 7.2 or greater.

Environment

  • SnapDevelop 2019 R2 beta2
  • OS Windows 10

Cause

For the new .NET Core / .NET Standard project created in SnapDevelop 2019 R2 beta2, the language version defaults to “C # latest major version”, which is C # 7.0. However, the translated C # code sometimes needs to use features higher than C # 7.0.

E.g. PowerScript “Readonly” parameters are translated into C# “in” parameters. The “in” parameter is a new feature in C# 7.2.

Resolution

  • In SnapDevelop > Solution Explorer, right-click your Project > Properties > Build > Advanced.
  • Change the language version from the default “C # latest major version (default)” to “C # latest minor version (latest)”, or the C # version required in the error message (e.g. C# 7.2).

1
1