Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...