Commit fae314e
[build] fix usage of /p:CscToolExe=
Context: https://build.azdo.io/3182458
Our build is currently failing with:
(CoreCompile target) ->
CSC : error CS1617: Invalid -langversion option `7.3'. It must be `ISO-1', `ISO-2', Default, Latest or value in range 1 to 7.2
I think this is due to:
/p:CscToolExe=`which mcs`
We need to use `mcs`, because `gendarme` does not yet support
portable `.pdb` files. However, it also appears that `mcs` does not
support C# 7.2.
If we set `/p:LangVersion=Default`, it will select a usable C#
version. Things might continue to work as long as we don't use a C#
7.3 feature.
This gets us to the next failure:
(CoreCompile target) ->
Microsoft.CSharp.Core.targets(59,5): error : error CS2001: Source file `/analyzerconfig:/Users/runner/runners/2.159.2/work/1/s/.editorconfig' could not be found
The error is a little misleading: basically `mcs` does not understand
the `/analyzerconfig` switch. So it is trying to treat it as a source
code file.
I found the source code for this here:
https://github.com/dotnet/roslyn/blob/6fc75491954be7ddff8c489a4ff424b3524ae80f/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets#L63
So we can add `/p:DiscoverEditorConfigFiles=False` to ignore
`.editorconfig` files.which mcs (#511)1 parent 73096d9 commit fae314e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
0 commit comments