0

I'm running an on-prem TFS 2018 U2 and I want to use the latest MsBuild (currently - the one from Visual Studio 2019).

The way I do it right now is running the MsBuild Task with the location for the version of MsBuild that I want to run.

Is there a more elegant way to do that, preferably a TFS Task, that won't require knowing the exact location?

Alenros
  • 816
  • 7
  • 23
  • 1
    I'm afraid it is indeed the solution, but I want to allow another day for someone to save me and give an alternative. In the meanwhile I have been looking into making an extension and solving it once and for all. – Alenros Dec 22 '20 at 07:57
  • I can fully understand your request. We want a smarter way to automatically find the msbuild installed on our server, instead of manually specifying the path of msbuild every time we use the msbuild task. But like I said, we have no way to specify a future product path. Because there is already a workaround to specify the path of msbuild, few people are willing to develop such an extension for this convenience. And an extension directly searches all local folders, which seems unsafe. So we have to manually specify the path of msbuild unless we upgrade our TFS server to a higher version. – Leo Liu Dec 23 '20 at 01:49

1 Answers1

1

Is there a more elegant way to do that, preferably a TFS Task, that won't require knowing the exact location?

I am afraid there is no more elegant way to do that. The method you use now is the best method.

That because the VS2019 was released after TFS 2018. TFS 2018 will not predict the next version and installation path of VS2019. This is why there is no VS2019 option in VS Build Task in TFS 2018 Server.

So, we have to specify the exact location of VS 2019 for the MSBuild task in TFS 2018, otherwise, Visual studio build/MSBuild build task will use the default MSBuild 15.0.

You could check this thread for some more details.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135