OpenWrap/openwrap

GetMSBuildExecutionPath not finding MSBuild.exe

Opened this issue · 1 comments

On one of my machines OpenWrap gets confused when trying to find the MSBuild execution path. It looks in @"%windir%\Microsoft.NET\Framework" for directories that start with "v"... However on that system there is also a folder "VJSharp" which is selected. Because it is given as an argument to Version, this fails.

So I would suggest to either use a more strict regular expression to find the executable, or check the registry. It seems there are registry keys of the form: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0\MSBuildToolsPath" that contain the correct path of MSBuild. Maybe it's better to use those if available and fall back to the other method if not?

The reg is probably the right approach, would be good to have that combined with selecting the version of msbuild and toolsversion is in use.

Seb

On 26 May 2012, at 13:49, "Ruben Vandeginste" reply@reply.github.com wrote:

On one of my machines OpenWrap gets confused when trying to find the MSBuild execution path. It looks in @"%windir%\Microsoft.NET\Framework" for directories that start with "v"... However on that system there is also a folder "VJSharp" which is selected. Because it is given as an argument to Version, this fails.

So I would suggest to either use a more strict regular expression to find the executable, or check the registry. It seems there are registry keys of the form: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0\MSBuildToolsPath" that contain the correct path of MSBuild. Maybe it's better to use those if available and fall back to the other method if not?


Reply to this email directly or view it on GitHub:
#324