Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable C# 7 support in VSTS

It appears that VSTS does not support C# 7, as I'm getting a build error which would would indicate the C# 6 compiler is being used. How do I enable C# 7, or what am I doing wrong? I'm using Visual Studio 2017, targeting .NET 4.6.1.

I would rather not have to revert C# 7 changes I've added if possible. As can be seen in the screenshot of Visual Studio and the console in VSTS, there is a difference in the version of C# in use.

enter image description here

like image 692
user9993 Avatar asked Dec 24 '22 14:12

user9993


1 Answers

OK so it turns out that it was a simple fix, it was a counter-intuitive option in the UI. There's actually 2 places that configure the version of Visual Studio being used in VSTS. It needs to be set to Visual Studio 2017 or Latest and Hosted VS2017. Why there are 2 options is not very clear.

enter image description here

like image 131
user9993 Avatar answered Jan 05 '23 00:01

user9993