Description
Because of our collaboration with ILSpy, we need to make sure ILCompiler.Reflection.ReadyToRun
do not use C# features that are not available in C# 7.3
This problem is not particularly severe, we had it just a couple of times in the past, such as #32460, or #37451.
It would be nice if we could fix the build so that the offending of that rule is caught at build time. However, because of a forceful setting in
runtime/Directory.Build.targets
Line 26 in 1705e68
Make overriding the LangVersion in ILCompiler.Reflection.ReadyToRun.csproj
does not work.
It is possible to fix by introducing a LangVersionOverride
like this:
<LangVersion Condition="'$(LangVersionOverride)' == ''">preview</LangVersion>
<LangVersion Condition="'$(LangVersionOverride)' != ''">$(LangVersionOverride)</LangVersion>
Not being an MSBuild expert, I don't know what is the best practice.
This issue is meant to leave this problem to the experts.