c# - TFS 构建 - C# 7.0 System.ValueType

标签 c# tfs azure-devops

我尝试在 VisualStudio.com 上设置持续集成构建来构建我的项目。由于我升级到 .net 4.6.2 并使用 System.ValueType,因此构建失败:

MinimalMonitoringClient\MMCThinNetwork\Connection.cs(91,23): Error CS1519: Invalid token '(' in class, struct, or interface member declaration Connection.cs(91,23): error CS1519: Invalid token '(' in class, struct, or interface member declaration [d:\a\1\s\MinimalMonitoringClient\MMCThinNetwork\MMCThinNetwork.csproj] MinimalMonitoringClient\MMCThinNetwork\Connection.cs(91,47): Error CS1044: Cannot use more than one type in a for, using, fixed, or declaration statement Connection.cs(91,47): error CS1044: Cannot use more than one type in a for, using, fixed, or declaration statement [d:\a\1\s\MinimalMonitoringClient\MMCThinNetwork\MMCThinNetwork.csproj] MinimalMonitoringClient\MMCThinNetwork\Connection.cs(91,64): Error CS1002: ; expected

  • 它在我的本地计算机上编译
  • 已安装 NuGet 包“System.ValueType”
  • TFS 上没有包文件夹
  • “恢复 NuGet 包”任务包含在构建过​​程中
  • NuGet 还原构建步骤成功完成

2017-04-22T14:42:13.2402898Z ##[section]Starting: NuGet restore **/*.sln 2017-04-22T14:42:13.2512895Z ============================================================================== 2017-04-22T14:42:13.2512895Z Task : NuGet Installer 2017-04-22T14:42:13.2512895Z Description : Installs or restores missing NuGet packages 2017-04-22T14:42:13.2512895Z Version : 0.2.31 2017-04-22T14:42:13.2512895Z Author : Microsoft Corporation 2017-04-22T14:42:13.2512895Z Help : More Information 2017-04-22T14:42:13.2512895Z ============================================================================== 2017-04-22T14:42:14.3517087Z [command]C:\Windows\system32\chcp.com 65001 2017-04-22T14:42:14.3517087Z Active code page: 65001 2017-04-22T14:42:14.4246880Z Detected NuGet version 3.3.0.212 / 3.3.0 2017-04-22T14:42:14.4276880Z SYSTEMVSSCONNECTION exists true 2017-04-22T14:42:14.4286876Z To connect to NuGet feeds hosted in your Team Services account/TFS project collection on this build agent, edit your build definition to choose a higher version of nuget or specify a path to a NuGet.config containing the package sources you wish to use. 2017-04-22T14:42:14.4316868Z [command]d:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive d:\a\1\s\MinimalMonitoringClient\MinimalMonitoringClient.sln 2017-04-22T14:42:15.2210188Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. 2017-04-22T14:42:15.4566895Z Feeds used: 2017-04-22T14:42:15.4566895Z C:\Users\buildguest\AppData\Local\NuGet\Cache 2017-04-22T14:42:15.4576898Z https://api.nuget.org/v3/index.json 2017-04-22T14:42:15.4576898Z 2017-04-22T14:42:15.4786896Z Restoring NuGet package System.ValueTuple.4.3.0. 2017-04-22T14:42:15.4896877Z Restoring NuGet package Newtonsoft.Json.10.0.2. 2017-04-22T14:42:16.5110192Z Adding package 'System.ValueTuple.4.3.0' to folder 'd:\a\1\s\MinimalMonitoringClient\packages' 2017-04-22T14:42:16.5330192Z Added package 'System.ValueTuple.4.3.0' to folder 'd:\a\1\s\MinimalMonitoringClient\packages' 2017-04-22T14:42:16.7550436Z Adding package 'Newtonsoft.Json.10.0.2' to folder 'd:\a\1\s\MinimalMonitoringClient\packages' 2017-04-22T14:42:16.7780484Z Added package 'Newtonsoft.Json.10.0.2' to folder 'd:\a\1\s\MinimalMonitoringClient\packages' 2017-04-22T14:42:16.8080211Z ##[section]Finishing: NuGet restore **/*.sln

  • 在构建解决方案中,VS 版本设置为:2017
  • 干净:正确
  • 恢复 NuGet 包:正确

提前致谢

最佳答案

您需要使用 Hosted VS2017 Build Agent 来编译使用 VS2017 的东西。

enter image description here

关于c# - TFS 构建 - C# 7.0 System.ValueType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43560656/

相关文章:

C# 套接字与 NodeJS Socket.IO

c# - 仅在 azure 上 : Could not create SSL/TLS secure channel

azure - AzureDev Ops Webhooks 是否有任何构建启动类型的触发器?

version-control - TFS:跨团队项目共享脚本的分支注意事项

tfs - VS2012 可以与 TFS2010 一起使用吗?

git - VSTS从多个存储库构建

azure-devops - Azure Devops Nuget 还原失败并显示 "unable to load the service index for source"

c# - 一个 super 简单的 MVVM-Light WP7 示例?

c# - 我的应用程序与任务计划程序一起使用,无法在我的 C# 代码中创建目录

c# - TFS 如何在 checkin 期间检查 C# 中的每个类是否具有 XML 摘要?