Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable C# 7 builds in Team Foundation Server 2015?

We have Team Foundation Server (TFS) 2015 installed on-premises. We would like to use Visual Studio 2017 to take advantage of the latest C# language features. We are not ready to upgrade to TFS 2017. What are the steps required to allow the latest C# language features to build in TFS 2015?

like image 679
Robin Avatar asked Jun 11 '17 16:06

Robin


People also ask

How do I enable C++ 11?

H2CO3 is right, you can use a makefile with the CXXFLAGS set with -std=c++11 A makefile is a simple text file with instructions about how to compile your program. Create a new file named Makefile (with a capital M). To automatically compile your code just type the make command in a terminal.

How do I enable C ++ 17 in G ++?

C++17 features are available since GCC 5. This mode is the default in GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well.

How do you specify STD C ++ 11 in your Makefile?

You can use command-line flag -std to explicitly specify the C++ standard. For example, -std=c++98 , or -std=gnu++98 (C++98 with GNU extensions) -std=c++11 , or -std=gnu++11 (C++11 with GNU extensions)


1 Answers

I didn't follow these steps exactly, but based on what I have learned, I think they would have worked:

  1. Install Visual Studio 2017 Build Tools on the XAML Build Configuration server
  2. Add these lines to the TFSBuildServiceHost.exe.config file:
  <configSections>
    <section name="msbuildToolsets" type="Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false" />
  </configSections>
  <msbuildToolsets>
    <toolset toolsVersion="15.0">
      <property name="MSBuildToolsPath" value="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" />
    </toolset>
    <toolset toolsVersion="latest">
      <property name="MSBuildToolsPath" value="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" />
    </toolset>
  </msbuildToolsets>

C:\Program Files\Microsoft Team Foundation Server 14.0\Tools\TFSBuildServiceHost.exe.config

(I never would have figure that out without this post. Thank you jonesy2488!)

  1. Restart the XAML Build Configuration service.
  2. Change the XAML Build Process Template to include the ToolVersion="15.0" parameter:
<mtba:RunMSBuild DisplayName="Run MSBuild" OutputLocation="[OutputLocation]" CleanBuild="[CleanBuild]" CommandLineArguments="[String.Format(&quot;/p:SkipInvalidConfigurations=true {0}&quot;, AdvancedBuildSettings.GetValue(Of String)(&quot;MSBuildArguments&quot;, String.Empty))]" ConfigurationsToBuild="[ConfigurationsToBuild]" ProjectsToBuild="[ProjectsToBuild]" ToolVersion="15.0" ToolPlatform="[AdvancedBuildSettings.GetValue(Of String)(&quot;MSBuildPlatform&quot;, &quot;Auto&quot;)]" RunCodeAnalysis="[AdvancedBuildSettings.GetValue(Of String)(&quot;RunCodeAnalysis&quot;, &quot;AsConfigured&quot;)]" />
like image 133
Robin Avatar answered Sep 22 '22 15:09

Robin