Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying C# 7 code to VSTS

I have a project where I am using C# 7 features. It builds fine locally, but when I build in Visual Studio Team Services, I get errors. All the errors point to this one project and they all look related to 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.

How can I get the project to build on VSTS?

like image 863
Dan Friedman Avatar asked Apr 06 '17 17:04

Dan Friedman


People also ask

What is deployment in C#?

Framework-dependent deployment. Deploying a framework-dependent deployment with no third-party dependencies simply involves building, testing, and publishing the app. A simple example written in C# illustrates the process. Create the project. Select File > New > Project.

What is deploy in Visual Studio?

In this articleVisual Studio enables three ways to deploy the Visual C++ libraries together with your application: central deployment, local deployment, and static linking. Central deployment puts the library files under the Windows directory, where all applications can access them automatically.

What is the difference between deploying and publishing an application?

Deployment: It is a process of deploying the pre compiled dll's to the IIS server. Publish: It is a process of creating precompiled dll's. Web Hosting: It is similar to the process of deployment of a website. Deployment: It is a process of deploying the pre compiled dll's to the IIS server.


1 Answers

You need to set the build to use the Hosted VS2017 agent queue to be able to use C# 7 features.

Hosted agents

like image 52
crashmstr Avatar answered Oct 05 '22 15:10

crashmstr