Open sandboxFocus

Property LanguageVersion

LanguageVersion

Gets the version of the C# language of the project under test, or null to use Metalama.Framework.Engine.Utilities.SupportedCSharpVersions.Latest.

Declaration
public LanguageVersion? LanguageVersion { get; init; }
Property Value
Type Description
LanguageVersion?
Remarks

This option is the equivalent of the LangVersion MSBuild property for a test. It is read by Metalama.Testing.UnitTesting.TestProjectOptions, and through it by the provider that gives the compile-time compilation its language version, so a test that requests the preview version covers compile-time code as well as run-time code. The value Preview also allows the preview language features, which a user project allows with the MetalamaAllowPreviewLanguageFeatures MSBuild property.