My project in Debug mode contains constructs that only supports C# 7.3. But in Release mode, the project should be built on C# 7.0 without specific code lines.
I know about some standard preprocessor symbols like NET472
and NETSTANDARD2_0
but it uses to work with different standards and their versions. And it useless for language version condition.
public static Expression<TDelegate> CreateExpression<TDelegate>()
where TDelegate : Delegate // Work in 7.3 and above
{ ... }
I expected some tricks like
#if CSharpVersion >= 7.3
where TDelegate : Delegate
#endif
Now I use that statement:
#if DEBUG
where TDelegate : Delegate
#endif
But it will not work if I change language versions in project properties.