sen*_*ico 5 c# linux mono c#-7.0
我正在尝试使用Mono 5在Linux构建服务器上编译我的新C#7代码.不幸的是,当我使用新的ValueTuple语法时,项目失败:
MyClass.cs(100,38):错误CS1003:语法错误,'('expected [/path/to/My.csproj]
我的项目文件中有以下包引用:
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
Run Code Online (Sandbox Code Playgroud)
我在快速构建脚本中使用以下命令:
# msbuild My.sln /t:restore
# msbuild My.sln /p:Configuration=Release /p:Platform="Any CPU"
Run Code Online (Sandbox Code Playgroud)
并且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.该项目现在编译没有错误.
我将假设修复了单声道中的错误以解决此问题.
| 归档时间: |
|
| 查看次数: |
639 次 |
| 最近记录: |