简体   繁体   English

将C#7代码部署到VSTS

[英]Deploying C# 7 code to VSTS

I have a project where I am using C# 7 features. 我有一个项目,我正在使用C#7功能。 It builds fine locally, but when I build in Visual Studio Team Services, I get errors. 它在本地构建良好,但是当我构建Visual Studio Team Services时,我会收到错误。 All the errors point to this one project and they all look related to C# 7: 所有错误都指向这个项目,它们都与C#7相关:

 Identifier expected
 Invalid expression term 'int'
 Syntax error, ',' expected
 Syntax error, '>' expected
 ) expected
 ; expected

The project targets.NET 4.6.1 and references Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.3 and Micosoft.Net.Compilers 2.0.1. 该项目的目标是.NET 4.6.1,并引用了Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.3和Micosoft.Net.Compilers 2.0.1。

How can I get the project to build on VSTS? 如何在VSTS上构建项目?

You need to set the build to use the Hosted VS2017 agent queue to be able to use C# 7 features. 您需要将构建设置为使用Hosted VS2017代理队列才能使用C#7功能。

Hosted agents 托管代理商

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM