问题描述
我们在本地安装了 Team Foundation Server (TFS) 2015.我们希望使用 Visual Studio 2017 来利用最新的 C# 语言功能.我们还没有准备好升级到 TFS 2017.允许在 TFS 2015 中构建最新的 C# 语言功能需要哪些步骤?
我没有完全按照这些步骤进行,但根据我所学到的,我认为它们会起作用:
- 安装 Visual Studio 2017 构建工具XAML 构建配置服务器
- 将这些行添加到 TFSBuildServiceHost.exe.config 文件中:
<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><msbuild 工具集><工具集工具版本="15.0"><property name="MSBuildToolsPath" value="C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Bin"/></工具集><工具集工具版本="最新"><property name="MSBuildToolsPath" value="C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Bin"/></工具集></msbuildToolsets>
<块引用>
C:Program FilesMicrosoft Team Foundation Server14.0ToolsTFSBuildServiceHost.exe.config
(如果没有这个,我永远不会弄明白发布.谢谢jonesy2488!)
- 重新启动 XAML 构建配置服务.
- 更改 XAML 构建过程模板以包含 ToolVersion="15.0" 参数:
<mtba:RunMSBuild DisplayName="Run MSBuild" OutputLocation="[OutputLocation]" CleanBuild="[CleanBuild]" CommandLineArguments="[String.Format("/p:SkipInvalidConfigurations=true {0}", AdvancedBuildSettings.GetValue(Of String)("MSBuildArguments", String.Empty))]" ConfigurationsToBuild="[ConfigurationsToBuild]" ProjectsToBuild="[ProjectsToBuild]" ToolVersion="15.0" ToolPlatform="[AdvancedBuildSettings.GetValue(Of String)("MSBuildPlatform", "Auto")]" RunCodeAnalysis="[AdvancedBuildSettings.GetValue(Of String)("RunCodeAnalysis", "AsConfigured")]"/>
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?
I didn't follow these steps exactly, but based on what I have learned, I think they would have worked:
- Install Visual Studio 2017 Build Tools on the XAML Build Configuration server
- 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 Studio2017BuildToolsMSBuild15.0Bin" />
</toolset>
<toolset toolsVersion="latest">
<property name="MSBuildToolsPath" value="C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Bin" />
</toolset>
</msbuildToolsets>
C:Program FilesMicrosoft Team Foundation Server 14.0ToolsTFSBuildServiceHost.exe.config
(I never would have figure that out without this post. Thank you jonesy2488!)
- Restart the XAML Build Configuration service.
- 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("/p:SkipInvalidConfigurations=true {0}", AdvancedBuildSettings.GetValue(Of String)("MSBuildArguments", String.Empty))]" ConfigurationsToBuild="[ConfigurationsToBuild]" ProjectsToBuild="[ProjectsToBuild]" ToolVersion="15.0" ToolPlatform="[AdvancedBuildSettings.GetValue(Of String)("MSBuildPlatform", "Auto")]" RunCodeAnalysis="[AdvancedBuildSettings.GetValue(Of String)("RunCodeAnalysis", "AsConfigured")]" />
这篇关于如何在 Team Foundation Server 2015 中启用 C# 7 构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!