2017-04-22 77 views
1

我尝试在VisualStudio.com上设置一个持续集成构建来构建我的项目。自从我升级到.NET 4.6.2,并与System.ValueType工作,构建失败:TFS Build - C#7.0 System.ValueType

MinimalMonitoringClient \ MMCThinNetwork \ Connection.cs(91,23):错误 CS1519:无效令牌 '(' 在类,结构或接口成员 声明Connection.cs(91,23):错误CS1519:无效标记'('in class,struct或interface member declaration [d:\ a \ 1 \ s \ MinimalMonitoringClient \ MMCThinNetwork \ MMCThinNetwork.csproj] MinimalMonitoringClient \ MMCThinNetwork \ Connection.cs(91,47):错误 CS1044:在for,using,fixed或 声明语句Connection.cs(91,47)中不能使用多个类型:错误CS1044:C在注册表中使用 多于一种类型 [d:\ a \ 1 \ s \ MinimalMonitoringClient \ MMCThinNetwork \ MMCThinNetwork.csproj] MinimalMonitoringClient \ MMCThinNetwork \ Connection.cs(91,64) :错误 CS1002:;预期

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

2017-04-22T14:42:13.2402898Z ##开始:NuGet恢复 **/*。sln 2017-04-22T14:42:13.2512895Z ============ ================================================== ================ 2017-04-22T14:42:13.2512895Z任务:NuGet安装程序 2017-04-22T14:42:13.2512895Z描述:安装或还原 缺少NuGet包2017-04-22T14:42:13.2512895Z版本: 0.2.31 2017-04-22T14:42:13.2512895Z作者:微软公司2017-04-22T14:42:13.2512895Z帮助: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有效代码页:650 01 2017-04-22T14:42:14.4246880Z检测到的NuGet版本3.3.0.212/3.3.0 2017-04-22T14:42:14.4276880Z SYSTEMVSSCONNECTION存在true 2017-04-22T14:42:14.4286876Z要连接到在此构建代理上的 Team Services帐户/ TFS项目集合中托管的NuGet源,编辑 您的构建定义以选择更高版本的nuget或指定包含要使用的包源的NuGet.config的 路径。 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 还原-NonInteractive d:\ a \ 1 \ s \ MinimalMonitoringClient \ MinimalMonitoringClient.sln 2017-04-22T14:42:15.2210188Z MSBuild自动检测:使用msbuild 版本'14.0'从'C:\ Program Files (86)\的MSBuild \ 14.0 \斌。 2017-04-22T14:42:15.4566895Z使用的源: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恢复 NuGet包System.ValueTuple.4.3.0。 2017-04-22T14:42:15.4896877Z 恢复NuGet包Newtonsoft.Json.10.0.2。 2017-04-22T14:42:16.5110192Z将文件夹'System.ValueTuple.4.3.0' 添加到文件夹'd:\ a \ 1 \ s \ MinimalMonitoringClient \ packages' 2017-04-22T14:42:16.5330192Z将文件夹'System.ValueTuple.4.3.0' 添加到文件夹'd:\ a \ 1 \ s \ MinimalMonitoringClient \ packages' 2017-04-22T14:42:16.7550436Z添加软件包'Newtonsoft.Json.10.0.2' 到文件夹'd:\ a \ 1 \ s \ MinimalMonitoringClient \ packages' 2017-04-22T14:42:16.7780484Z添加软件包'Newtonsoft.Json.10.0.2'到 文件夹'd:\ a \ 1 \ s \ MinimalMonitoringClient \ packages' 2017-04-22T14:42:16.8080211Z ##整理:NuGet恢复 **/*。sln

  • 在生成解决方案的VS版本设置为:2017年
  • 清洁:真
  • 恢复的NuGet包:真正的提前

感谢

+0

MSBuild的版本14,它不使用Visual Studio 2017年编译器,它使用2015年版。 –

+0

即使使用2015年设置,我也无法成功编译。同样的例外。 –

回答

3

您需要使用托管VS2017构建代理来编译使用VS2017的东西。

enter image description here

+0

这个伎俩。非常感谢你。 –