-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use vswhere to search for vs2017+ install directory to locate msbuild #1752
Use vswhere to search for vs2017+ install directory to locate msbuild #1752
Conversation
Good job @yuyoyuppe! 😃 |
src/app/FakeLib/MSBuildHelper.fs
Outdated
@@ -96,6 +96,15 @@ let msBuildExe = | |||
] | |||
defaultArg (sources |> List.choose id |> List.tryHead) "xbuild" | |||
| false, _ -> | |||
let getVSPathFromVSWhere ver = | |||
ExecProcessAndReturnMessages(fun info -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this throws when the VSWhere
file doesn't exist. Is this available on all VS Versions? What if no Visual Studio is installed?
Good change, only one thing: Can you check what happens when no Visual Studio is installed or VSWhere is missing for some reason? Or investigate if VSWhere is always available. Thank you. |
Additionally we need to update the new FAKE 5 modules as well (not only the Obsolete ones). They can be found in |
You could also use the nuget package for vswhere so that you know that it exists regardless (but you would then need to take a dependency on that package). |
I'd be fine with that dependency, considering that it will be local to the 'Fake.DotNet.MsBuild' module. we probably would disable that feature in fakelib in that scenario |
@yuyoyuppe ping? |
@matthid ah, sorry, completely forgot! :( I'll try fixing the mentioned issues this weekend. |
Is this ready (it is red)? |
@matthid I think there's a cleaner way to achieve the same result: just run |
VS native command tool prompt is not available on all platforms. It's only available when you have installed VS for Windows (something that you might not want to do on a build server). |
I think this would be viable as long as it still works when But if there is no interest in finishing this. Should we close the PR? |
Looks like it has been superseded by #2077 |
FAKE assumes VS is installed in ProgramFilesX86, which wasn't the case for me. We could use
vswhere
utility with reliable location to determine VS2017+ installation path.