[英]C# version error when building with msbuild, ok with Visual Studio
I can build my project just fine using Visual Studio 2017; 我可以使用Visual Studio 2017很好地构建项目; however when I use msbuild 15, I get this eror: 但是,当我使用msbuild 15时,出现以下错误:
error CS8306: Tuple element name 'value' is inferred. 错误CS8306:推断出元组元素名称“值”。 Please use language version 7.1 or greater to access an element by its inferred name. 请使用语言版本7.1或更高版本通过推断的名称访问元素。
The language version is set to 7.3 in my project file; 在我的项目文件中,语言版本设置为7.3。 why would I get this error when running msbuild? 为什么在运行msbuild时会出现此错误?
I figured it out - thanks to Olivier Jacot-Descombes who suggested I look in the project properties! 我想通了-感谢Olivier Jacot-Descombes建议我查看项目属性!
What I needed to do was set my C# version for all platforms (eg any CPU, x68, x64) to 7.3 in addition to setting it for all configurations (debug/release) as he'd suggested. 除了他建议的所有配置 (调试/发行版)设置之外,我需要做的是将所有平台 (例如,任何CPU,x68,x64)的C#版本设置为7.3。
MSbuild 15
does not support .NET Framework 4.7.2
. MSbuild 15
不支持.NET Framework 4.7.2
。
Per the GitHub issue, this was merged in May: github.com/Microsoft/msbuild/issues/3285 根据GitHub问题,该文档已于5月合并: github.com/Microsoft/msbuild/issues/3285
Version 15.7.180
should work: https://github.com/Microsoft/msbuild/releases/tag/v15.7.180.61344 版本15.7.180
应该可以正常工作: https : //github.com/Microsoft/msbuild/releases/tag/v15.7.180.61344
Edit: Version 15.8.166.59604
shipped with Visual Studio 15.8, which was released in April. 编辑:Visual Studio 15.8附带的版本15.8.166.59604
,于4月发布。 Though, support for .NET Framework 4.7.2, was implemented in May. 但是,对.NET Framework 4.7.2的支持已在5月实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.