Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Devops Release pipeline unable to take latest C# version

I have a console application which has async calls for e.g. the signature of the main method looks like this

static async Task MainAsync(string[] args)
{

}

I am able to compile the build in my local machine. But I have a VSTS (DevOps Azure) CI/CD pipeline where I am using a custom hosted agent in that machine, over there once the CI executes it gives the error:

##[error]CSC(0,0): Error CS5001: Program does not contain a static 'Main' method suitable for an entry point

like image 727
user1037747 Avatar asked Sep 18 '18 14:09

user1037747


People also ask

Are Azure DevOps release pipelines deprecated?

Draft releases are deprecated in Azure Pipelines because you can change variables while you're creating the release. Creating a draft release allows you to edit some settings for the release and tasks, depending on your role permissions before you start the deployment.

How do you release a pipeline in Azure DevOps?

Go to the Pipelines tab, and then select Releases. Select the action to create a New pipeline. If a release pipeline is already created, select the plus sign ( + ) and then select Create a release pipeline. Select the action to start with an Empty job.

Is Microsoft phasing out Azure DevOps?

First, Microsoft is discontinuing the Azure DevOps Services Preview Program. This program allowed users to try out new features and get early feedback. With the program ending, feedback will no longer be available to help improve Azure DevOps. PRO TIP: No, Azure DevOps is not being deprecated.


1 Answers

I got it working by forcing the user agent to use VS2017. Click phase 1 and then change it to the following: HostedVS2017

This forces the user agent to use 2017 which has the latest version of C# instead of 2015 (which it was falling back to for me).

like image 200
Bellatorius Avatar answered Dec 30 '22 12:12

Bellatorius