使用 Mono 5 编译包含 ValueTuple 的 C# 7 代码
Compiling C# 7 code containing ValueTuple with Mono 5
我正在尝试使用 Mono 5 在 Linux 构建服务器上编译新的 C# 7 代码。不幸的是,当我使用新的 ValueTuple 语法时,项目失败了:
MyClass.cs(100,38): error CS1003: Syntax error, '(' expected [/path/to/My.csproj]
我的项目文件中有以下包引用:
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
并且我在我的快速构建脚本中使用了以下命令:
# msbuild My.sln /t:restore
# msbuild My.sln /p:Configuration=Release /p:Platform="Any CPU"
并且 MSBuild 日志指示语言版本 7 并显示对 System.ValueTuple.dll:
的引用
CoreCompile:
/usr/lib/mono/4.5/csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702 /langversion:7 /nostdlib+ /errorreport:prompt /warn:4 /doc:bin/Release/net461/My.xml /define:TRACE;RELEASE;NET461 /highentropyva+ ... /reference:/root/.nuget/packages/system.valuetuple/4.3.0/lib/netstandard1.0/System.ValueTuple.dll ... /debug- /debug:portable /filealign:512 /nologo /optimize+ /out:obj/Release/net461/My.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output /deterministic+ My.cs "/tmp/.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" obj/Release/net461/My.AssemblyInfo.cs
是否有人使用 Mono 5 在 Linux 上使用新的 ValueTuple 语法成功编译了 C#?是刚好能用,还是需要调整环境才能用?
我的构建服务器是 运行 Ubuntu 16.04 并且安装了 mono-devel 5.0.1.1-0xamarin5+ubuntu1604b1。
我卸载了稳定版 mono-devel 5.0.1.1-0xamarin5+ubuntu1604b1 并将其替换为 beta mono-devel 5.2.0.196-0xamarin7+ubuntu1604b1。该项目现在编译没有错误。
我假设已修复解决此问题的单声道错误。
我正在尝试使用 Mono 5 在 Linux 构建服务器上编译新的 C# 7 代码。不幸的是,当我使用新的 ValueTuple 语法时,项目失败了:
MyClass.cs(100,38): error CS1003: Syntax error, '(' expected [/path/to/My.csproj]
我的项目文件中有以下包引用:
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
并且我在我的快速构建脚本中使用了以下命令:
# msbuild My.sln /t:restore
# msbuild My.sln /p:Configuration=Release /p:Platform="Any CPU"
并且 MSBuild 日志指示语言版本 7 并显示对 System.ValueTuple.dll:
的引用CoreCompile:
/usr/lib/mono/4.5/csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702 /langversion:7 /nostdlib+ /errorreport:prompt /warn:4 /doc:bin/Release/net461/My.xml /define:TRACE;RELEASE;NET461 /highentropyva+ ... /reference:/root/.nuget/packages/system.valuetuple/4.3.0/lib/netstandard1.0/System.ValueTuple.dll ... /debug- /debug:portable /filealign:512 /nologo /optimize+ /out:obj/Release/net461/My.dll /subsystemversion:6.00 /target:library /warnaserror- /utf8output /deterministic+ My.cs "/tmp/.NETFramework,Version=v4.6.1.AssemblyAttributes.cs" obj/Release/net461/My.AssemblyInfo.cs
是否有人使用 Mono 5 在 Linux 上使用新的 ValueTuple 语法成功编译了 C#?是刚好能用,还是需要调整环境才能用?
我的构建服务器是 运行 Ubuntu 16.04 并且安装了 mono-devel 5.0.1.1-0xamarin5+ubuntu1604b1。
我卸载了稳定版 mono-devel 5.0.1.1-0xamarin5+ubuntu1604b1 并将其替换为 beta mono-devel 5.2.0.196-0xamarin7+ubuntu1604b1。该项目现在编译没有错误。
我假设已修复解决此问题的单声道错误。