Manually building VS 2017 solution on TeamCity 9


Just upgraded to Visual Studio 2017, and quickly realized that TeamCity 9.1.7 (the version we have installed presently) does not support VS 2017.  I can compile a VS 2017 solution using the VS 2015 solution runner, so long as I don't make use of any C# 7.0 language constructs (which was kind of the point of updating, really).  

Was told by our DevOps team that an upgrade to TeamCity 10 is not in the cards for a while, so that is not currently an option.  

Given that you have to install Visual Studio on the build agent in order for it to even work, is there a way we can tell TeamCity (or, rather, have TeamCity tell the build agent) to compile a VS 2017 solution without requiring the VS 2017 sln runner?  For example, the NUnit build step allows us to manually specify the location and arguments for a console runner; is there something similar for .NET code compilation, by any chance?  

Comment actions Permalink

Hello Mike,

Visual Studio 2017 is supported only since TeamCoty 10.0.4 and it's not possible to run Visual Studio in previous versions. If you can use MSBuild to run the build, then you can use Command Line runner in TeamCity, to start the build using MSBuild.exe.

Comment actions Permalink

Aha.  And, presumably, I would specify the path to the version of MSBuild.exe that comes with VS 2017 in the script content?  OK, that might be worth investigating.  And, in theory, I could call csc directly if I really wanted to go hard-core.  

Possibly I might use an ANT script, then.  We do that in some of our other builds (and have a special MSBuild target), but I never did that for this one because it was just easier to let TC do the work for me.  

This is helpful.  Thanks!  


Please sign in to leave a comment.