Where does Powershell and PSake execute msbuild from?
Asked Answered
E

2

6

While making a build automation I came across an issue. Along with upgrading Visual Studio 2013, the path to MSBuild has moved as described here http://timrayburn.net/blog/visual-studio-2013-and-msbuild/

I've updated my system path to point to this new location for msbuild. Using a regular cmd prompt msbuild resolves just fine. But running my scripts in powershell, it seems to still pick up the old one, and showing the issue as described in the link. How can I see and change where powershell and psake picks up msbuild from, so I can point to the expected version?

Eccentricity answered 8/1, 2014 at 15:27 Comment(0)
A
8

PSake supports more MSBuild versions on one box. You can choose version and platform eg. 4.0x64 with framework directive. Path to MSBuild tools is not taken from $env:path but is computed. It uses registry to find proper path.

VS 2013 and MSBuild Tools are supported since PSake 4.3

Alkaloid answered 9/1, 2014 at 6:21 Comment(2)
And to save you the next search, you use the framework directive like this: Invoke-Psake -framework 4.5.2Bauer
Or you can write it on the first line of your script.Dirham
C
0

In PS type [Environment]::GetEnvironmentVariable("Path")

Do you see both paths? In what sequence do they appear? What occurs in cmd vs ps when you switch the order?

Cheese answered 8/1, 2014 at 16:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.