Works with C # 6

We recently upgraded to TFS 2015 from 2010. As a result of this update, we wanted to start using the C# 6 syntax in our projects, but whenever we do this, the assembly fails due to syntax errors. Build components / controllers are also located in the TFS 2015 installer (this is a whole new set of servers).

Our builds use the TfvcTemplate.12.xaml process TfvcTemplate.12.xaml , which appears to be the TFS2013 xaml assembly template.

According to this answer, you can change the template to set ToolsVersion correctly, but our template does not have a Run MSBuild for Project element, it has Run MSBuild activity, which does not have the specified properties.

I also tried setting the arguments tv:14.0 and /p:VisualStudioVersion=14.0 to MSBuild from the assembly definition from this , but this also does not solve the problem.

What do we need to do to get the assembly to accept the C# 6 syntax?

+5
source share
1 answer
  • If you are using VS 2015, then C # 6 should work out of the box. Try creating a lightweight C # 6.0 project and creating an XAML queue assembly to see if the problem is with your project or with the build server.

  • Before using the XAML assembly, make sure that you have successfully created the MSBuild command line manually on the assembly agent server.

  • If you upgrade to C # 6.0, check out the Project Migration to .NET 4.6 and C # 6 blog to see if this is useful.

0
source

All Articles