Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

c# - Build VS2017 project with TFS 2012 build server

We have an on-premise TFS 2012 server and build server. We are in the process of upgrading to VS and TFS 2017. At the moment, there is the request to set up another build server that will allow us to build new 2017 projects from the existing TFS server. I create a new build server and installed TFS 2012 build services on it as well as VS2017. I created a new build definition but it fails to compile and errors show things like the syntax changes for 2017 that are invalid in 2012. How do I tell configure this to build the project against the installed VS2017?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Thanks to this post, I was able to use TFS 2012 continuous integration with build server building C# 6 syntax using Visual studio 2017. Hopefully this will save the next person some time in trying to figure this out.

Here are the list of things I have changed in order to get TFS 2012 to build c# 6 syntax. On the machine with the build agent, install vs 2017 enterprise, on the installation setup page, make sure MS build is selected enter image description here

Edit the Build definition and make sure the MSBuild Argument is /tv:15.0 /p:GenerateBuildInfoConfigFile=false /p:VisualStudioVersion=15.0

enter image description here

Check the template your build definition is using and modify it by going to the source control explorer and going into the team project and undert BuildProcessTemplate, it should have the .xaml file, modify it by double clicking on itenter image description here

There should be 2 actions that say Run MSBuild for Project. You need to change both of their toolpath property to point to the msbuild.exe parent folder on the build server. In my case, the build server is a 32 bit machine so the path to the Bin folder doesn't have (x86) next to Program Files, you need to check your build server to enter the correct path here. enter image description here After you have made the changes, you need to save the xaml and check it in.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...